/**
 * かうたす - 認証ページ CSS
 * モダンなグラスモーフィズムデザイン
 */

/* ======================================
   認証ページ レイアウト
   ====================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(145deg, #fafffe 0%, #f7fdfb 30%, #f5fbf9 60%, #fafcff 100%);
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

/* ======================================
   認証カード
   ====================================== */
.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(16, 185, 129, 0.1);
    padding: 40px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======================================
   ロゴ・ヘッダー
   ====================================== */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.auth-logo-icon i {
    font-size: 36px;
    color: white;
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.auth-logo p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 8px 0 0;
}

/* ======================================
   タブ切り替え
   ====================================== */
.auth-tabs {
    display: flex;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.auth-tab:hover {
    color: var(--primary);
}

.auth-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ======================================
   フォーム
   ====================================== */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-label i {
    color: var(--primary);
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.form-input-wrapper {
    position: relative;
}

/* 入力フィールド内のアイコンは非表示（ラベル横に移動したため） */
.form-input-wrapper > i:first-child {
    display: none;
}

.form-input-wrapper .toggle-password {
    position: absolute;
    right: 12px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
}

.form-input-wrapper .toggle-password:hover {
    color: var(--primary);
}

.auth-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(16, 185, 129, 0.15);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.auth-input::placeholder {
    color: var(--text-muted);
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.auth-input:focus + i,
.form-input-wrapper:focus-within i:first-of-type {
    color: var(--primary);
}

/* パスワード強度インジケーター */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.strength-bar.active {
    background: var(--primary);
}

.strength-bar.weak.active {
    background: #ef4444;
}

.strength-bar.medium.active {
    background: #f59e0b;
}

.strength-bar.strong.active {
    background: var(--primary);
}

.password-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ======================================
   ボタン
   ====================================== */
.auth-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-btn .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.auth-btn.loading .spinner {
    display: block;
}

.auth-btn.loading span {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ======================================
   補足リンク
   ====================================== */
.auth-links {
    margin-top: 16px;
    text-align: center;
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ======================================
   区切り線
   ====================================== */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(16, 185, 129, 0.15);
}

.auth-divider span {
    padding: 0 16px;
}

/* ======================================
   ソーシャルログイン
   ====================================== */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-btn {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid rgba(16, 185, 129, 0.15);
    background: white;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.social-btn:hover {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
}

.social-btn img {
    width: 20px;
    height: 20px;
}

/* ======================================
   エラー・成功メッセージ
   ====================================== */
.auth-message {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-dark);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.auth-message.info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.auth-message i {
    font-size: 16px;
}

/* ======================================
   チェックボックス
   ====================================== */
.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ======================================
   パスワードリセットフォーム
   ====================================== */
.reset-form-container {
    display: none;
}

.reset-form-container.active {
    display: block;
}

.back-to-login {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 24px;
    transition: color 0.3s ease;
}

.back-to-login:hover {
    color: var(--primary);
}

/* ======================================
   フッター
   ====================================== */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(16, 185, 129, 0.1);
}

.auth-footer p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ======================================
   レスポンシブ対応
   ====================================== */
@media (max-width: 767px) {
    .auth-page {
        padding: 16px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .auth-card {
        padding: 28px 24px;
        border-radius: 20px;
    }
    
    .auth-logo-icon {
        width: 70px;
        height: 70px;
    }
    
    .auth-logo-icon i {
        font-size: 32px;
    }
    
    .auth-logo h1 {
        font-size: 24px;
    }
    
    .auth-tab {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .auth-input {
        padding: 12px 14px 12px 44px;
        font-size: 16px; /* iOSズーム防止 */
    }
    
    .auth-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .auth-container {
        max-width: 400px;
    }
    
    .auth-card {
        padding: 36px;
    }
}
