/* 統一的認證頁面樣式 */

/* 背景和容器 */
.hero-section {
    min-height: calc(100vh - var(--nav-height));
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("/static/images/home_image.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 20px;
}

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1;
}

.auth-box {
    background: rgba(255, 255, 255, 0.15);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    width: 100%;
    min-width: 400px;
    max-width: 480px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
}

/* 標題樣式 */
.auth-box h2 {
    margin-bottom: 2rem;
    text-align: center;
    color: white;
    font-size: 1.6rem;
    font-weight: 600;
    position: relative;
}

.auth-box h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: white;
    border-radius: 2px;
}

/* 表單樣式 */
.form-group {
    margin-bottom: 1.5rem;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i:not(.toggle-password) {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    z-index: 1;
    pointer-events: none;
}

.input-with-icon .toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    z-index: 2;
    pointer-events: auto;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: transparent;
    padding: 0;
    margin: 0;
}

.input-with-icon .toggle-password:hover {
    color: white;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-group input[type="password"],
.form-group input[type="text"]#password,
.form-group input[type="text"]#confirm_password {
    padding-right: 40px;
}

/* 處理自動填充時的背景和文字顏色 */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.1) inset !important;
    -webkit-text-fill-color: white !important;
    caret-color: white;
    transition: background-color 5000s ease-in-out 0s;
    border-color: rgba(255, 255, 255, 0.2);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.form-group input:invalid {
    border-color: rgba(220, 38, 38, 0.5);
}

.form-group input:valid {
    border-color: rgba(34, 197, 94, 0.5);
}

/* 記住我和忘記密碼 */
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
}

.forgot-password {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: white;
    text-decoration: underline;
}

/* 條款同意 */
.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.terms-checkbox input[type="checkbox"] {
    width: auto;
    margin-top: 2px;
    padding: 0;
}

.terms-checkbox label {
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

.terms-link {
    color: #4285F4;
    text-decoration: none;
    font-weight: 500;
}

.terms-link:hover {
    text-decoration: underline;
}

/* 按鈕樣式 */
.login-button, .signup-button {
    width: 100%;
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.login-button {
    background-color: #4285F4;
    color: white;
}

.login-button::before {
    content: '\f2f6';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.login-button:hover {
    transform: translateY(-2px);
    background-color: #3367D6;
    box-shadow: 0 5px 15px rgba(66, 133, 244, 0.3);
}

.signup-button {
    background-color: #34A853;
    color: white;
}

.signup-button::before {
    content: '\f234';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.signup-button:hover {
    transform: translateY(-2px);
    background-color: #2E7D32;
    box-shadow: 0 5px 15px rgba(52, 168, 83, 0.3);
}

.signup-button:disabled {
    background-color: #6B7280;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 分隔線 */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: rgba(255, 255, 255, 0.8) !important;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.divider span {
    margin: 0 10px;
    font-size: 0.9rem;
}

/* 社交登入 */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.social-button.google {
    background: white;
    border-color: #dadce0;
    color: #3c4043;
}

.social-button.google i {
    background: conic-gradient(from -45deg, #ea4335 110deg, #4285f4 90deg 180deg, #34a853 180deg 270deg, #fbbc05 270deg) 73% 55%/150% 150% no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.social-button.google:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
}

/* 連結樣式 */
.signup-link, .login-link {
    font-size: 0.95rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.signup-link a, .login-link a {
    color: white;
    font-weight: 600;
    text-decoration: none;
    margin-left: 5px;
    transition: all 0.3s;
}

.signup-link a:hover, .login-link a:hover {
    text-decoration: underline;
}

/* 驗證頁面特定樣式 */
.verification-header {
    text-align: center;
    margin-bottom: 2rem;
}

.verification-icon {
    width: 80px;
    height: 80px;
    background: rgba(66, 133, 244, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    border: 2px solid rgba(66, 133, 244, 0.3);
}

.verification-icon i {
    font-size: 2rem;
    color: #4285F4;
}

.verification-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.5;
}

.email-display {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2rem;
}

.email-display i {
    color: #4285F4;
    font-size: 1.1rem;
}

.email-display span {
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
}

.verification-steps {
    margin-bottom: 2rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.step-number {
    width: 30px;
    height: 30px;
    background: #4285F4;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-content h4 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.step-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.verification-actions {
    text-align: center;
    margin-bottom: 2rem;
}

.resend-button {
    background: #4285F4;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.resend-button:hover {
    background: #3367D6;
    transform: translateY(-1px);
}

.resend-button:disabled {
    background: #6B7280;
    cursor: not-allowed;
    transform: none;
}

.resend-timer {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.resend-timer i {
    color: #F59E0B;
}

.verification-footer {
    text-align: center;
    margin-bottom: 2rem;
}

.verification-footer p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.change-email-button {
    background: transparent;
    color: #4285F4;
    border: 1px solid #4285F4;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.change-email-button:hover {
    background: rgba(66, 133, 244, 0.1);
}

/* 密碼強度指示器 */
.password-strength {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.password-strength.weak {
    color: #ef4444;
}

.password-strength.medium {
    color: #f59e0b;
}

.password-strength.strong {
    color: #10b981;
}

/* 警告訊息樣式 */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.alert-error {
    background: rgba(220, 38, 38, 0.2);
    color: #fff;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.alert-error::before {
    content: '\f071';
}

.alert-success {
    background: rgba(34, 197, 94, 0.2);
    color: #fff;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-success::before {
    content: '\f00c';
}

.alert-info {
    background: rgba(59, 130, 246, 0.2);
    color: #fff;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.alert-info::before {
    content: '\f05a';
}

/* 響應式設計 */
@media (max-width: 768px) {
    .auth-box {
        margin: 20px;
        padding: 2rem;
    }
    .auth-box h2 {
        font-size: 1.2rem;
    }
    .remember-forgot {
        font-size: 0.8rem;
    }
    .signup-link, .login-link {
        font-size: 0.8rem;
    }
    .terms-checkbox {
        font-size: 0.8rem;
    }
    .verification-header h2 {
        font-size: 1.3rem;
    }
    .step {
        padding: 0.75rem;
    }
    .step-content h4 {
        font-size: 0.95rem;
    }
    .step-content p {
        font-size: 0.85rem;
    }
}
