/* Simple User Manager Styles - 改良版 */

.simple-user-form {
    max-width: 500px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
    line-height: 1.6;
}

.simple-user-form h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

/* 入力条件説明ボックス */
.input-requirements {
    background: #f0f8ff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border-left: 4px solid #0073aa;
}

.input-requirements h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #0073aa;
    font-size: 16px;
}

.input-requirements ul {
    margin: 10px 0;
    padding-left: 20px;
}

.input-requirements li {
    margin-bottom: 5px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group.focused label {
    color: #0073aa;
    font-weight: 600;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
    transition: color 0.3s ease;
}

.required {
    color: #e74c3c;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    transform: translateY(-1px);
}

.form-group input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
    background-color: #fdf2f2;
}

.form-group input.warning {
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
    background-color: #fef9e7;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ヘルプテキスト */
.field-help {
    display: none;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    padding: 5px 8px;
    background: #f8f9fa;
    border-radius: 3px;
    border-left: 3px solid #0073aa;
}

/* チェックボックス */
.form-group input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* ボタン */
.simple-user-form button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.simple-user-form button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004066 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
}

.simple-user-form button:active {
    transform: translateY(0);
}

.simple-user-form button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.delete-button {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
}

.delete-button:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%) !important;
}

/* メッセージ */
.success {
    padding: 12px;
    margin: 15px 0;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    border-left: 4px solid #28a745;
    animation: slideInDown 0.5s ease;
}

.error {
    padding: 12px;
    margin: 15px 0;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    border-left: 4px solid #dc3545;
    animation: slideInDown 0.5s ease;
}

.warning {
    padding: 15px;
    margin: 15px 0;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    border-left: 4px solid #f39c12;
}

.info {
    padding: 12px;
    margin: 15px 0;
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    border-left: 4px solid #17a2b8;
}

/* パスワード強度 */
.password-strength {
    margin-top: 5px;
    font-size: 14px;
    padding: 5px 8px;
    border-radius: 3px;
    background: #f8f9fa;
}

/* ユーザー名チェック */
.username-check {
    margin-top: 5px;
    font-size: 14px;
    padding: 5px 8px;
    border-radius: 3px;
    background: #f8f9fa;
}

/* リンク */
.simple-user-form a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.simple-user-form a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .simple-user-form {
        margin: 10px;
        padding: 20px;
        border-radius: 0;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .simple-user-form h3 {
        font-size: 20px;
    }
    
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* iOS zoom prevention */
    }
}

@media (max-width: 480px) {
    .input-requirements {
        padding: 10px;
        font-size: 14px;
    }
    
    .input-requirements ul {
        padding-left: 15px;
    }
}

/* アニメーション */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.simple-user-form {
    animation: fadeInUp 0.5s ease-out;
}

/* ローディング状態 */
.simple-user-form.loading {
    opacity: 0.7;
    pointer-events: none;
}

.simple-user-form.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* アクセシビリティ */
.form-group input:focus-visible,
.form-group textarea:focus-visible,
.simple-user-form button:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .simple-user-form {
        background: #2c3e50;
        color: #ecf0f1;
        border: 1px solid #34495e;
    }
    
    .simple-user-form h3 {
        color: #ecf0f1;
    }
    
    .form-group label {
        color: #bdc3c7;
    }
    
    .form-group input,
    .form-group textarea {
        background: #34495e;
        color: #ecf0f1;
        border-color: #4a5f7a;
    }
    
    .form-group input:focus,
    .form-group textarea:focus {
        border-color: #3498db;
        background: #2c3e50;
    }
    
    .input-requirements {
        background: #34495e;
        border-left-color: #3498db;
    }
    
    .input-requirements h4 {
        color: #3498db;
    }
    
    .field-help {
        background: #34495e;
        color: #bdc3c7;
        border-left-color: #3498db;
    }
    
    .success {
        background: #1e3a2e;
        color: #a8e6cf;
        border-color: #27ae60;
    }
    
    .error {
        background: #3e1e1e;
        color: #ffb3b3;
        border-color: #e74c3c;
    }
    
    .warning {
        background: #3e3a1e;
        color: #ffd93d;
        border-color: #f39c12;
    }
    
    .info {
        background: #1e3a3e;
        color: #a8d8e6;
        border-color: #17a2b8;
    }
}

/* 印刷対応 */
@media print {
    .simple-user-form {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .simple-user-form button {
        display: none;
    }
    
    .success, .error, .warning, .info {
        border: 1px solid #000;
        background: none !important;
    }
}



/* パスワード表示切り替えボタンの改良 */
.form-group {
    position: relative;
}

.form-group input[type="password"],
.form-group input[type="text"] {
    padding-right: 65px !important;
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid #ddd;
    background: #f7f7f7;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 3px;
    color: #666;
    z-index: 10;
    transition: all 0.3s ease;
    width: 55px;
    text-align: center;
}

.password-toggle-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.password-toggle-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* パスワードリセット確認画面用のスタイル（独立ページ用） */
.reset-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 500px;
    margin: 20px auto;
    width: 100%;
    box-sizing: border-box;
}

.reset-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.security-info {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* メール認証成功画面用のスタイル（独立ページ用） */
.success-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 500px;
    margin: 20px auto;
}

.success-icon {
    font-size: 4em;
    color: #28a745;
    margin-bottom: 20px;
}

.success-container h1 {
    color: #333;
    margin-bottom: 20px;
}

.success-container p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
    margin: 0 10px;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
}

/* 管理画面用の通知改良 */
.notice.notice-info.is-dismissible {
    border-left-color: #0073aa;
}

.notice.notice-info.is-dismissible p {
    margin: 0.5em 0;
}

/* レスポンシブ対応の改良 */
@media (max-width: 768px) {
    .reset-container,
    .success-container {
        margin: 10px;
        padding: 30px 20px;
    }
    
    .success-icon {
        font-size: 3em;
    }
    
    .btn {
        display: block;
        margin: 10px 0;
        text-align: center;
    }
}

/* フォーカス時のアクセシビリティ改良 */
.simple-user-form input:focus-visible,
.simple-user-form textarea:focus-visible,
.simple-user-form button:focus-visible,
.password-toggle-btn:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ダークモード対応の改良 */
@media (prefers-color-scheme: dark) {
    .password-toggle-btn {
        background: #495057;
        color: #f8f9fa;
        border-color: #6c757d;
    }
    
    .password-toggle-btn:hover {
        background: #5a6268;
        border-color: #7a8288;
    }
    
    .security-info {
        background: #1e3a3e;
        color: #a8d8e6;
        border-left-color: #17a2b8;
    }
    
    .reset-container,
    .success-container {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .reset-container h1,
    .success-container h1 {
        color: #ecf0f1;
    }
    
    .reset-container input,
    .success-container input {
        background: #34495e;
        color: #ecf0f1;
        border-color: #4a5f7a;
    }
}