/* ============================================================
   Huapont — Authentication Pages (Login / Register)
   ------------------------------------------------------------
   Thiết kế 2 cột: Left (brand/welcome) + Right (form)
   Đồng bộ theme: đen + vàng kim nhạt, professional, minimal
   ============================================================ */

/* ===== Page Header / Breadcrumb ===== */
.auth-header {
    background: #f7f7f5;
    border-bottom: 1px solid #e8e6e1;
    padding: 42px 24px;
}
.auth-header-inner {
    max-width: 1280px;
    margin: 0 auto;
}
.auth-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
    color: var(--color-ink-500);
    margin-bottom: 12px;
    font-family: var(--font-display);
}
.auth-breadcrumb a {
    color: var(--color-ink-500);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}
.auth-breadcrumb a:hover {
    color: var(--color-gold-700);
}
.auth-breadcrumb .sep {
    color: var(--color-ink-300);
}
.auth-page-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 500;
    color: #292d33;
    margin: 0;
    line-height: var(--lh-tight);
}

/* ===== Main Authentication Section ===== */
.auth-main {
    padding: 70px 24px 90px;
    background: var(--color-white);
    min-height: calc(100vh - var(--navbar-height) - 200px);
    display: flex;
    align-items: center;
}
.auth-container {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}
.auth-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 580px;
    box-shadow: var(--shadow-sm);
}

/* ===== Left Side — Welcome / Brand Area ===== */
.auth-welcome {
    background: #292d33;
    background-image: 
        linear-gradient(
            rgba(25, 29, 32, 0.75),
            rgba(25, 29, 32, 0.88)
        ),
        url('/images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 3px 0 0 3px;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--color-white);
    position: relative;
}
.auth-welcome::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, var(--color-gold-500) 0%, transparent 70%);
    opacity: 0.08;
    pointer-events: none;
}
.auth-welcome-content {
    position: relative;
    z-index: 1;
}
.auth-eyebrow {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #b69a68;
    text-transform: uppercase;
    margin-bottom: 16px;
    font-family: var(--font-display);
}
.auth-welcome-title {
    font-family: var(--font-display);
    font-size: 42px;
    line-height: 1.25;
    font-weight: 500;
    color: var(--color-white);
    margin: 0 0 20px;
    max-width: 440px;
}
.auth-welcome-desc {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.72);
    max-width: 440px;
    margin-bottom: 32px;
    font-family: var(--font-display);
}
.auth-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, 0.85);
}
.auth-feature-item .icon {
    width: 20px;
    height: 20px;
    color: #b69a68;
    flex-shrink: 0;
}

/* ===== Right Side — Form ===== */
.auth-form-wrapper {
    background: var(--color-white);
    padding: 60px;
    border: 1px solid #ececec;
    border-left: none;
    border-radius: 0 3px 3px 0;
}
.auth-form-header {
    margin-bottom: 32px;
}
.auth-form-eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.8px;
    color: var(--color-ink-400);
    text-transform: uppercase;
    margin-bottom: 8px;
    font-family: var(--font-display);
}
.auth-form-title {
    font-family: var(--font-display);
    font-size: 38px;
    font-weight: 500;
    color: #292d33;
    margin: 0 0 12px;
    line-height: var(--lh-tight);
}
.auth-form-desc {
    font-size: var(--fs-sm);
    color: var(--color-ink-500);
    line-height: var(--lh-normal);
    margin: 0;
    font-family: var(--font-display);
}

/* ===== Form Fields ===== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.auth-field label {
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--color-ink-800);
}
.auth-field-input {
    position: relative;
}
.auth-field input {
    height: 54px;
    width: 100%;
    padding: 0 16px;
    border: 1px solid #dedede;
    background: var(--color-white);
    color: #292d33;
    font-size: 15px;
    font-family: var(--font-display);
    outline: none;
    border-radius: 3px;
    transition: all 0.25s ease;
}
.auth-field input::placeholder {
    color: var(--color-ink-400);
}
.auth-field input:focus {
    border-color: #b69a68;
    box-shadow: 0 0 0 3px rgba(182, 154, 104, 0.08);
}
.auth-field input.has-error {
    border-color: #d9534f;
}
.auth-field .error-message {
    font-size: var(--fs-xs);
    color: #d9534f;
    margin-top: 4px;
    font-family: var(--font-display);
}
.auth-field .success-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-success);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--color-ink-400);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease-out);
}
.password-toggle:hover {
    background: var(--color-ink-050);
    color: var(--color-ink-700);
}
.password-toggle .icon {
    width: 18px;
    height: 18px;
}

/* ===== Remember / Forgot ===== */
.auth-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.auth-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #b69a68;
}
.auth-checkbox label {
    font-size: var(--fs-sm);
    color: var(--color-ink-700);
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 500;
}
.auth-forgot-link {
    font-size: var(--fs-sm);
    color: #8e764b;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 500;
    transition: color var(--duration-fast) var(--ease-out);
}
.auth-forgot-link:hover {
    color: var(--color-gold-700);
    text-decoration: underline;
}

/* ===== Submit Button ===== */
.auth-submit {
    height: 54px;
    background: #b69a68;
    color: var(--color-white);
    border: none;
    border-radius: 2px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    font-family: var(--font-display);
    transition: all 0.25s ease;
    margin-top: 8px;
}
.auth-submit:hover {
    background: #9f8455;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(182, 154, 104, 0.25);
}
.auth-submit:active {
    transform: translateY(0);
}
.auth-submit:disabled {
    background: var(--color-ink-300);
    cursor: not-allowed;
    transform: none;
}
.auth-submit.is-loading {
    position: relative;
    color: transparent;
}
.auth-submit.is-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid var(--color-white);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Divider ===== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: #999;
    font-size: 13px;
    font-family: var(--font-display);
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e5e5;
}

/* ===== Social Login ===== */
.auth-social {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.auth-social-btn {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #dedede;
    background: transparent;
    border-radius: 3px;
    font-size: var(--fs-sm);
    font-weight: 500;
    font-family: var(--font-display);
    color: var(--color-ink-800);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}
.auth-social-btn:hover {
    border-color: #b69a68;
    background: #faf9f7;
}
.auth-social-btn .icon {
    width: 20px;
    height: 20px;
}

/* ===== Footer Link ===== */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: var(--fs-sm);
    color: var(--color-ink-600);
    font-family: var(--font-display);
}
.auth-footer a {
    color: var(--color-gold-700);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}
.auth-footer a:hover {
    color: var(--color-gold-900);
    text-decoration: underline;
}

/* ===== Alert Messages ===== */
.auth-alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--fs-sm);
    font-family: var(--font-display);
    border: 1px solid transparent;
}
.auth-alert .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.auth-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}
.auth-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* ===== Terms checkbox (Register) ===== */
.auth-terms {
    font-size: var(--fs-sm);
    color: var(--color-ink-600);
    line-height: var(--lh-normal);
    font-family: var(--font-display);
}
.auth-terms a {
    color: var(--color-gold-700);
    text-decoration: none;
    font-weight: 500;
}
.auth-terms a:hover {
    text-decoration: underline;
}

/* ============================================================
   Dark theme overrides
   ============================================================ */
:root[data-theme="dark"] .auth-header {
    background: var(--color-ink-800);
    border-bottom-color: var(--color-ink-700);
}
:root[data-theme="dark"] .auth-page-title {
    color: var(--color-white);
}
:root[data-theme="dark"] .auth-breadcrumb {
    color: var(--color-ink-300);
}
:root[data-theme="dark"] .auth-breadcrumb a {
    color: var(--color-ink-300);
}
:root[data-theme="dark"] .auth-breadcrumb a:hover {
    color: var(--color-gold-400);
}
:root[data-theme="dark"] .auth-main {
    background: var(--color-bg);
}
:root[data-theme="dark"] .auth-form-wrapper {
    background: var(--color-ink-800);
    border-color: var(--color-ink-700);
}
:root[data-theme="dark"] .auth-form-title {
    color: var(--color-white);
}
:root[data-theme="dark"] .auth-form-desc {
    color: var(--color-ink-300);
}
:root[data-theme="dark"] .auth-form-eyebrow {
    color: var(--color-ink-400);
}
:root[data-theme="dark"] .auth-field label {
    color: var(--color-ink-200);
}
:root[data-theme="dark"] .auth-field input {
    background: var(--color-ink-900);
    border-color: var(--color-ink-600);
    color: var(--color-white);
}
:root[data-theme="dark"] .auth-field input:focus {
    border-color: var(--color-gold-500);
    box-shadow: 0 0 0 3px rgba(182, 154, 104, 0.15);
}
:root[data-theme="dark"] .auth-checkbox label {
    color: var(--color-ink-200);
}
:root[data-theme="dark"] .auth-forgot-link {
    color: var(--color-gold-400);
}
:root[data-theme="dark"] .auth-forgot-link:hover {
    color: var(--color-gold-300);
}
:root[data-theme="dark"] .auth-footer {
    color: var(--color-ink-300);
}
:root[data-theme="dark"] .auth-footer a {
    color: var(--color-gold-400);
}
:root[data-theme="dark"] .auth-footer a:hover {
    color: var(--color-gold-300);
}
:root[data-theme="dark"] .auth-social-btn {
    border-color: var(--color-ink-600);
    color: var(--color-ink-200);
}
:root[data-theme="dark"] .auth-social-btn:hover {
    border-color: var(--color-gold-500);
    background: var(--color-ink-700);
}
:root[data-theme="dark"] .auth-divider {
    color: var(--color-ink-400);
}
:root[data-theme="dark"] .auth-divider::before,
:root[data-theme="dark"] .auth-divider::after {
    background: var(--color-ink-700);
}
:root[data-theme="dark"] .password-toggle {
    color: var(--color-ink-400);
}
:root[data-theme="dark"] .password-toggle:hover {
    background: var(--color-ink-700);
    color: var(--color-ink-200);
}
:root[data-theme="dark"] .auth-terms {
    color: var(--color-ink-300);
}
:root[data-theme="dark"] .auth-terms a {
    color: var(--color-gold-400);
}

/* ============================================================
   Responsive — Tablet & Mobile
   ============================================================ */
@media (max-width: 900px) {
    .auth-card {
        grid-template-columns: 1fr;
        max-width: 620px;
        margin: 0 auto;
    }
    .auth-welcome {
        border-radius: 3px 3px 0 0;
        padding: 40px;
        min-height: 240px;
    }
    .auth-welcome-title {
        font-size: 32px;
    }
    .auth-feature-list {
        display: none;
    }
    .auth-form-wrapper {
        border: 1px solid #ececec;
        border-radius: 0 0 3px 3px;
        padding: 40px;
    }
    .auth-form-title {
        font-size: 32px;
    }
}

@media (max-width: 640px) {
    .auth-header {
        padding: 32px 20px;
    }
    .auth-page-title {
        font-size: 28px;
    }
    .auth-main {
        padding: 40px 20px 60px;
    }
    .auth-welcome {
        padding: 32px 24px;
        min-height: 200px;
    }
    .auth-welcome-title {
        font-size: 26px;
    }
    .auth-welcome-desc {
        font-size: 15px;
    }
    .auth-form-wrapper {
        padding: 32px 24px;
    }
    .auth-form-title {
        font-size: 26px;
    }
    .auth-social {
        grid-template-columns: 1fr;
    }
    .auth-field-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
