/* =========================================================
   好物推薦網 — register.css
   註冊頁 & 驗證碼頁專用樣式：
   Auth Layout、Form Card、Input Fields、OTP Inputs、
   APP-style Verify Page、Responsive
   ========================================================= */

/* ===== AUTH LAYOUT ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-hero {
    background: linear-gradient(160deg, #2d5a3d 0%, var(--color-primary) 40%, var(--color-primary-light) 100%);
    padding: 2rem 0 3.5rem;
    position: relative;
    overflow: hidden;
    text-align: center;
    color: #fff;
}

.auth-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(249, 166, 32, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(138, 181, 152, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-hero h1 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #fff;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.auth-hero p {
    font-size: 0.92rem;
    opacity: 0.85;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

/* ===== FORM CARD ===== */
.auth-form-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 1rem 3rem;
    margin-top: -3rem;
    position: relative;
    z-index: 2;
}

.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--color-border);
}

.auth-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card-header .auth-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    margin: 0 auto 1rem;
}

.auth-card-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}

.auth-card-header p {
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

/* ===== FORM FIELDS ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--color-text);
    margin-bottom: 0.4rem;
}

.form-group label .required {
    color: var(--color-accent);
    margin-left: 2px;
}

.form-input-wrap {
    position: relative;
}

.form-input-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.form-input-wrap .input-icon-right {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 1rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.form-input-wrap .input-icon-right:hover {
    color: var(--color-primary);
}

.form-control-auth {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.form-control-auth::placeholder {
    color: #b5b0a6;
}

.form-control-auth:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.12);
}

.form-control-auth:focus ~ .input-icon {
    color: var(--color-primary);
}

.form-control-auth.has-right-icon {
    padding-right: 2.75rem;
}

/* Validation states */
.form-control-auth.is-valid {
    border-color: var(--color-success);
}

.form-control-auth.is-valid ~ .input-icon {
    color: var(--color-success);
}

.form-control-auth.is-invalid {
    border-color: var(--color-accent);
}

.form-control-auth.is-invalid ~ .input-icon {
    color: var(--color-accent);
}

.form-feedback {
    font-size: 0.8rem;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.form-feedback.valid {
    color: var(--color-success);
}

.form-feedback.invalid {
    color: var(--color-accent);
}

.form-feedback i {
    font-size: 0.85rem;
}

/* Password strength */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 0.5rem;
}

.password-strength .strength-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--color-border);
    transition: background 0.3s ease;
}

.password-strength .strength-bar.active.weak {
    background: var(--color-accent);
}

.password-strength .strength-bar.active.medium {
    background: var(--color-cta);
}

.password-strength .strength-bar.active.strong {
    background: var(--color-success);
}

.password-strength-text {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* Birthday field */
.form-control-auth[type="date"] {
    position: relative;
}

.form-control-auth[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.form-control-auth[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* ===== TERMS CHECKBOX ===== */
.form-check-auth {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 1.5rem 0;
}

.form-check-auth input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.form-check-auth label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1.5;
}

.form-check-auth label a {
    color: var(--color-primary);
    font-weight: 600;
}

.form-check-auth label a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ===== LOGIN OPTIONS (Remember + Forgot) ===== */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.25rem 0 1.5rem;
}

.forgot-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
}

.forgot-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ===== FORGOT PASSWORD FORM (inside verify-content) ===== */
.forgot-form {
    width: 100%;
    text-align: left;
}

.forgot-form .form-group {
    margin-bottom: 1.25rem;
}

/* ===== SUBMIT BUTTON ===== */
.btn-auth-submit {
    width: 100%;
    padding: 0.85rem;
    background: var(--color-cta);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-auth-submit:hover {
    background: var(--color-cta-dark);
    transform: translateY(-1px);
}

.btn-auth-submit:active {
    transform: translateY(0);
}

.btn-auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-auth-submit .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.btn-auth-submit.loading .spinner {
    display: block;
}

.btn-auth-submit.loading .btn-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== DIVIDER ===== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* ===== SOCIAL LOGIN ===== */
.social-login-group {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.btn-social {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.btn-social:hover {
    border-color: var(--color-primary);
    background: rgba(74, 124, 89, 0.05);
    transform: translateY(-2px);
}

/* ===== AUTH FOOTER LINK ===== */
.auth-footer-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

.auth-footer-text a {
    color: var(--color-primary);
    font-weight: 600;
}

.auth-footer-text a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* =========================================================
   驗證碼頁面 — APP 風格
   ========================================================= */

/* ===== VERIFY APP LAYOUT ===== */
.verify-app {
    min-height: 100vh;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
}

.verify-app-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-back:hover {
    background: rgba(74, 124, 89, 0.06);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.verify-app-header .step-indicator {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ===== VERIFY CONTENT ===== */
.verify-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    text-align: center;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.verify-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(74, 124, 89, 0.12), rgba(107, 158, 122, 0.12));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.verify-icon i {
    font-size: 2rem;
    color: var(--color-primary);
}

.verify-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.verify-content .verify-desc {
    color: var(--color-text-muted);
    font-size: 0.92rem;
    margin-bottom: 0.25rem;
    line-height: 1.6;
}

.verify-email-display {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* ===== OTP INPUT ===== */
.otp-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.otp-input {
    width: 50px;
    height: 58px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-surface);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    caret-color: var(--color-primary);
}

.otp-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.12);
}

.otp-input.filled {
    border-color: var(--color-primary);
    background: rgba(74, 124, 89, 0.04);
}

.otp-input.is-invalid {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(183, 71, 42, 0.1);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* ===== VERIFY ACTIONS ===== */
.verify-actions {
    width: 100%;
    margin-bottom: 2rem;
}

.btn-verify-submit {
    width: 100%;
    padding: 0.85rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-verify-submit:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.btn-verify-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-verify-submit .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.btn-verify-submit.loading .spinner {
    display: block;
}

.btn-verify-submit.loading .btn-text {
    display: none;
}

/* ===== RESEND ===== */
.resend-section {
    margin-top: 1.5rem;
}

.resend-text {
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

.resend-timer {
    font-weight: 600;
    color: var(--color-primary);
}

.btn-resend {
    background: none;
    border: none;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.88rem;
    font-family: var(--font-body);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-resend:hover {
    background: rgba(74, 124, 89, 0.08);
    color: var(--color-primary-dark);
}

.btn-resend:disabled {
    color: var(--color-text-muted);
    cursor: not-allowed;
    background: none;
}

/* ===== VERIFY SUCCESS STATE ===== */
.verify-success {
    display: none;
    text-align: center;
}

.verify-success.show {
    display: block;
}

.verify-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: #fff;
    font-size: 2rem;
}

.verify-success h3 {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
}

.verify-success p {
    color: var(--color-text-muted);
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
}

.btn-go-home {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--color-cta);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-go-home:hover {
    background: var(--color-cta-dark);
    color: #fff;
    transform: translateY(-1px);
}

/* ===== VERIFY ERROR ===== */
.verify-error {
    font-size: 0.85rem;
    color: var(--color-accent);
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 1.5em;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 575.98px) {
    .auth-hero {
        padding: 1.5rem 0 3rem;
    }

    .auth-hero h1 {
        font-size: 1.3rem;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
        border-radius: var(--radius);
    }

    .otp-input {
        width: 44px;
        height: 52px;
        font-size: 1.3rem;
    }

    .otp-input-group {
        gap: 8px;
    }

    .verify-content {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 767.98px) {
    .auth-hero h1 {
        font-size: 1.4rem;
    }

    .auth-form-wrapper {
        margin-top: -2rem;
    }
}
