﻿/* ============================================================
   BST ENGINEERS BD — AUTH.CSS
   Login & Register split-screen layout
   ============================================================ */

/* ── RESET FOR AUTH PAGES ── */
.auth-body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100dvh;
}

/* ============================================================
   AUTH PAGE — SPLIT LAYOUT
   ============================================================ */
.auth-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100dvh;
    overflow: hidden;
}

/* ============================================================
   LEFT PANEL — brand / visual
   ============================================================ */
.auth-panel--left {
    position: relative;
    overflow: hidden;
}

.auth-panel-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.04);
    transition: transform 8s ease;
}

.auth-panel--left:hover .auth-panel-bg {
    transform: scale(1);
}

.auth-panel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient( 160deg, rgba(10, 9, 8, 0.82) 0%, rgba(137, 112, 89, 0.35) 55%, rgba(10, 9, 8, 0.78) 100% );
}

.auth-panel-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 36px 44px 40px;
}

/* Back to site link */
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color var(--transition), gap var(--transition);
    align-self: flex-start;
}

    .auth-back:hover {
        color: var(--gold-light);
        gap: 12px;
    }

/* Brand block */
.auth-brand {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Reuse .logo from site.css — colours already set */
.auth-panel--left .logo-name {
    color: var(--white);
}

.auth-panel--left .logo-sub {
    color: rgba(255,255,255,0.4);
}

.auth-quote {
    border-left: 2px solid var(--gold);
    padding-left: 20px;
    margin: 0;
}

    .auth-quote p {
        font-family: var(--font-serif);
        font-size: 1.18rem;
        font-style: italic;
        font-weight: 300;
        color: rgba(255, 255, 255, 0.72);
        line-height: 1.65;
        margin: 0;
    }

/* Stats strip at the bottom of left panel */
.auth-panel-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 18px 24px;
}

.auth-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.auth-stat-num {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gold-light);
    line-height: 1;
}

.auth-stat-label {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
}

.auth-stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,0.12);
    flex-shrink: 0;
}

/* ============================================================
   RIGHT PANEL — form
   ============================================================ */
.auth-panel--right {
    background: var(--white);
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-panel-right-inner {
    width: 100%;
    max-width: 460px;
    padding: 52px 48px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Mobile logo — hidden on desktop */
.auth-mobile-logo {
    display: none;
    margin-bottom: 28px;
}

/* ============================================================
   AUTH HEADER
   ============================================================ */
.auth-header {
    margin-bottom: 32px;
}

.auth-eyebrow {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

    .auth-eyebrow::before {
        content: '';
        display: block;
        width: 24px;
        height: 1px;
        background: var(--gold);
    }

.auth-title {
    font-family: var(--font-serif);
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-weight: 400;
    color: var(--dark);
    line-height: 1.2;
    margin: 0 0 10px;
}

.auth-sub {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.7;
    margin: 0;
}

/* ============================================================
   ALERTS
   ============================================================ */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--radius);
    font-size: 0.82rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

    .auth-alert:empty {
        display: none;
    }

.auth-alert--success {
    background: #eaf7f0;
    border: 1px solid #a3d9b8;
    color: #1d6b3e;
}

.auth-alert--error {
    background: #fdf0ef;
    border: 1px solid #f5c2be;
    color: #a93226;
}

/* ============================================================
   FORM
   ============================================================ */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Two-column row for name / password pairs */
.auth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.auth-field--checkbox {
    margin-top: 4px;
    margin-bottom: 22px;
}

.auth-field label {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mid);
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.forgot-link {
    font-size: 0.72rem;
    color: var(--gold);
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: color var(--transition);
}

    .forgot-link:hover {
        color: var(--dark);
    }

/* Input wrapper with icon */
.field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 14px;
    color: var(--muted);
    pointer-events: none;
    flex-shrink: 0;
    transition: color var(--transition);
}

.auth-input {
    width: 100%;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 300;
    color: var(--dark);
    background: var(--light-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 44px 12px 42px;
    outline: none;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
}

    .auth-input::placeholder {
        color: #C0B8B0;
    }

    .auth-input:focus {
        border-color: var(--gold);
        background: var(--white);
        box-shadow: 0 0 0 4px rgba(137,112,89,0.1);
    }
/* Highlight icon on focus */
.field-wrap:focus-within .field-icon {
    color: var(--gold);
}

/* Validation states */
.auth-input.input-invalid {
    border-color: #e74c3c;
    background: #fff8f8;
}

.auth-input.input-valid {
    border-color: #27ae60;
}

/* Password toggle button */
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    display: flex;
    align-items: center;
    padding: 4px;
    transition: color var(--transition);
}

    .toggle-password:hover {
        color: var(--gold);
    }

/* Field error message */
.field-error {
    font-size: 0.71rem;
    color: #c0392b;
    display: block;
    min-height: 16px;
    line-height: 1.4;
}

/* ============================================================
   PASSWORD STRENGTH METER
   ============================================================ */
.password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: -10px;
    margin-bottom: 18px;
    padding: 0 2px;
}

.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    opacity: 0.18;
    transition: background 0.35s ease, opacity 0.35s ease;
}

.strength-label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--muted);
    white-space: nowrap;
    transition: color 0.35s ease;
    min-width: 90px;
    text-align: right;
}

/* ============================================================
   REMEMBER ME / TERMS CHECKBOX
   ============================================================ */
.auth-remember {
    margin-bottom: 22px;
}

.checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

    .checkbox-wrap input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 3px;
    background: var(--light-bg);
    flex-shrink: 0;
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition), background var(--transition);
    position: relative;
}

    /* Checkmark */
    .checkbox-custom::after {
        content: '';
        display: block;
        width: 5px;
        height: 9px;
        border-right: 2px solid var(--white);
        border-bottom: 2px solid var(--white);
        transform: rotate(45deg) scale(0) translateY(-1px);
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

.checkbox-wrap input:checked ~ .checkbox-custom {
    background: var(--gold);
    border-color: var(--gold);
}

    .checkbox-wrap input:checked ~ .checkbox-custom::after {
        transform: rotate(45deg) scale(1) translateY(-1px);
    }

.checkbox-wrap:hover .checkbox-custom {
    border-color: var(--gold);
}

.checkbox-label {
    font-size: 0.82rem;
    color: var(--mid);
    line-height: 1.5;
}

.terms-link {
    color: var(--gold);
    text-decoration: none;
    transition: color var(--transition);
}

    .terms-link:hover {
        color: var(--dark);
        text-decoration: underline;
    }

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */
.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 28px;
    background: var(--gold);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}
    /* Shimmer on hover */
    .auth-submit::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 60%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
        transition: left 0.5s ease;
    }

    .auth-submit:hover::before {
        left: 140%;
    }

    .auth-submit:hover {
        background: var(--dark);
        transform: translateY(-1px);
        box-shadow: 0 6px 24px rgba(15,14,12,0.2);
    }

    .auth-submit:active {
        transform: translateY(0);
    }

/* ============================================================
   SOCIAL LOGIN
   ============================================================ */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

    .auth-divider::before,
    .auth-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border);
    }

.auth-socials {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 16px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--dark);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    letter-spacing: 0.04em;
}

    .social-btn:hover {
        border-color: var(--gold-pale);
        background: var(--light-bg);
        box-shadow: var(--shadow-sm);
    }

/* ============================================================
   SWITCH LINK & DEMO HINT
   ============================================================ */
.auth-switch {
    text-align: center;
    font-size: 0.83rem;
    color: var(--muted);
    margin: 0 0 16px;
}

    .auth-switch a {
        color: var(--gold);
        font-weight: 500;
        text-decoration: none;
        transition: color var(--transition);
    }

        .auth-switch a:hover {
            color: var(--dark);
        }

.auth-demo-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--light-bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin: 0;
    text-align: center;
}

    .auth-demo-hint svg {
        flex-shrink: 0;
        color: var(--gold);
    }

    .auth-demo-hint strong {
        color: var(--dark);
    }

/* ============================================================
   SIDEBAR AUTH BUTTONS
   ============================================================ */
.sidebar-auth-links {
    padding: 20px 3px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

    .sidebar-auth-links .btn {
        justify-content: center;
        font-size: 0.73rem;
        letter-spacing: 0.12em;
    }

    /* btn-outline inside dark sidebar — use white border/text */
    .sidebar-auth-links .btn-outline {
        color: rgba(255,255,255,0.65);
        border-color: rgba(255,255,255,0.18);
        background: transparent;
    }

        .sidebar-auth-links .btn-outline:hover {
            color: var(--white);
            border-color: var(--gold);
            background: rgba(137,112,89,0.12);
        }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .auth-panel-right-inner {
        padding: 44px 40px;
    }
}

@media (max-width: 768px) {
    .auth-body {
        overflow-y: auto;
    }

    .auth-page {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    /* Hide left panel on mobile */
    .auth-panel--left {
        display: none;
    }

    .auth-panel--right {
        align-items: flex-start;
        min-height: 100dvh;
    }

    .auth-panel-right-inner {
        padding: 36px 28px 48px;
        max-width: 100%;
    }

    /* Show mobile logo */
    .auth-mobile-logo {
        display: flex;
    }

    .auth-field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 400px) {
    .auth-panel-right-inner {
        padding: 28px 20px 40px;
    }

    .auth-socials {
        grid-template-columns: 1fr;
    }
}
