/* USR002E - ユーザー登録/編集画面 スタイル */

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.screen-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4a90d9;
}

/* フォームセクション */
.form-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* フォームグリッド */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.875rem;
    color: #333;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

.form-group input:disabled,
.form-group select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.field-hint {
    font-size: 0.75rem;
    color: #999;
    margin-top: 4px;
}

.required {
    color: #ef4444;
}

/* チェックボックスグループ */
.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    padding: 0;
}

/* エラーメッセージ */
.error-message {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

/* ボタン */
.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.cancel-button,
.save-button {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cancel-button {
    background-color: #6c757d;
    color: white;
}

.cancel-button:hover {
    background-color: #5a6268;
}

.save-button {
    background-color: #4a90d9;
    color: white;
}

.save-button:hover {
    background-color: #006f5e;
}

.save-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* パスワード変更モード */
.password-mode .form-section:not(#password-section) {
    display: none;
}

.password-mode #password-section {
    margin-top: 0;
}

/* 入力エラー状態 */
.input-error {
    border-color: #ef4444 !important;
}

.input-error:focus {
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2) !important;
}

/* ローディング */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4a90d9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* レスポンシブ */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-buttons {
        flex-direction: column-reverse;
    }

    .cancel-button,
    .save-button {
        width: 100%;
    }
}
