/*
 * Authentication pages (login, register, password reset, customer/vendor login).
 * The primary colour comes from the admin-selected theme via --auth-primary,
 * set inline in layouts/auth.blade.php. Logical properties keep RTL working.
 */
.auth-modern {
    --auth-primary: #0C7785;
    --auth-primary-soft: color-mix(in srgb, var(--auth-primary) 10%, #fff);
    --auth-primary-dark: color-mix(in srgb, var(--auth-primary) 80%, #000);
    --auth-bg: #f0f4f3;
    --auth-surface: #ffffff;
    --auth-text: #1f2937;
    --auth-muted: #6b7280;
    --auth-border: #e2e8f0;
    --auth-radius: 12px;
    --auth-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);

    margin: 0;
    min-height: 100vh;
    background: var(--auth-bg);
    color: var(--auth-text);
    font-family: "Open Sans", sans-serif;
}

.auth-modern.auth-dark {
    --auth-bg: #0f1419;
    --auth-surface: #1a2027;
    --auth-text: #e5e7eb;
    --auth-muted: #9ca3af;
    --auth-border: #2d3540;
    --auth-primary-soft: color-mix(in srgb, var(--auth-primary) 20%, #1a2027);
    --auth-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.auth-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- Top bar ---------- */
.auth-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--auth-surface);
    border-bottom: 1px solid var(--auth-border);
}

.auth-topbar .navbar {
    padding: 0.75rem 1.5rem;
    gap: 1rem;
}

.auth-topbar .navbar-brand img {
    height: 38px;
    width: auto;
}

.auth-topbar .navbar-nav {
    gap: 0.25rem;
}

.auth-topbar .nav-link {
    padding: 0.5rem 0.75rem !important;
    border-radius: 8px;
    color: var(--auth-muted) !important;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.15s, background-color 0.15s;
}

.auth-topbar .nav-link:hover,
.auth-topbar .nav-link:focus {
    color: var(--auth-primary) !important;
    background: var(--auth-primary-soft);
}

.auth-topbar .navbar-toggler {
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    padding: 0.4rem 0.55rem;
    color: var(--auth-text);
    box-shadow: none;
}

.auth-topbar-end {
    display: flex;
    align-items: center;
    margin-inline-start: auto;
}

/* Language switcher (markup comes from each view's auth-lang section) */
.auth-lang {
    list-style: none;
    margin: 0;
    padding: 0;
}

.auth-lang .dash-h-item {
    list-style: none;
}

.auth-lang .dash-head-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: var(--auth-surface);
    color: var(--auth-text);
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-lang .dash-head-link:hover {
    border-color: var(--auth-primary);
    color: var(--auth-primary);
}

.auth-lang .dropdown-menu {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    box-shadow: var(--auth-shadow);
    background: var(--auth-surface);
}

.auth-lang .dropdown-item {
    font-size: 0.875rem;
    color: var(--auth-text);
}

.auth-lang .dropdown-item.active,
.auth-lang .dropdown-item:active {
    background: var(--auth-primary);
    color: #fff;
}

/* ---------- Split layout ---------- */
.auth-main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    padding: 3rem clamp(2rem, 5vw, 4.5rem);
    overflow: hidden;
    background: linear-gradient(150deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    color: #fff;
}

.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.auth-brand::before {
    width: 420px;
    height: 420px;
    inset-block-start: -160px;
    inset-inline-end: -140px;
}

.auth-brand::after {
    width: 300px;
    height: 300px;
    inset-block-end: -120px;
    inset-inline-start: -100px;
}

.auth-brand > * {
    position: relative;
    z-index: 1;
}

.auth-brand-eyebrow {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-brand h1 {
    margin: 1rem 0 0.75rem;
    color: #fff;
    font-size: clamp(1.75rem, 2.6vw, 2.4rem);
    font-weight: 700;
    line-height: 1.2;
}

.auth-brand p {
    margin: 0;
    max-width: 30rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.6;
}

.auth-features {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.auth-feature-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
}

.auth-feature-icon svg {
    width: 20px;
    height: 20px;
}

.auth-features strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
}

.auth-features span {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
}

.auth-brand-art {
    max-width: 360px;
    width: 100%;
    opacity: 0.95;
}

/* Shipping illustration at the top of the brand panel (SVG in the brand colours). */
.auth-brand-photo {
    width: 100%;
    max-width: 520px;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
}

.auth-brand-photo img {
    display: block;
    width: 100%;
    height: auto;
}

/* Short laptop screens: keep the whole panel visible without scrolling. */
@media (max-height: 820px) {
    .auth-brand {
        gap: 1.5rem;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .auth-brand h1 {
        font-size: clamp(1.5rem, 2.2vw, 2rem);
    }

    .auth-brand-photo {
        max-width: 400px;
    }
}

@media (max-height: 680px) {
    .auth-brand-photo {
        display: none;
    }
}

/* ---------- Form panel ---------- */
.auth-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 3rem 1.5rem 1.5rem;
}

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

.auth-card h2 {
    margin-bottom: 0.25rem;
    color: var(--auth-text);
    font-size: 1.6rem;
    font-weight: 700;
}

.auth-subtitle {
    margin-bottom: 1.75rem;
    color: var(--auth-muted);
    font-size: 0.925rem;
}

.auth-card .form-label {
    margin-bottom: 0.4rem;
    color: var(--auth-text);
    font-size: 0.85rem;
    font-weight: 600;
}

.auth-card .form-control {
    height: 46px;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: var(--auth-surface);
    color: var(--auth-text);
    font-size: 0.925rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-card .form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-primary) 18%, transparent);
}

.auth-card .form-control.is-invalid {
    border-color: #dc3545;
}

/* Inputs with a leading icon and/or trailing button */
.auth-input {
    position: relative;
}

.auth-input .auth-input-icon {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 0.9rem;
    width: 18px;
    height: 18px;
    color: var(--auth-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.auth-input .form-control {
    padding-inline-start: 2.6rem;
}

.auth-input .form-control.has-action {
    padding-inline-end: 2.9rem;
}

.auth-input-action {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-end: 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--auth-muted);
    transform: translateY(-50%);
    cursor: pointer;
}

.auth-input-action:hover,
.auth-input-action:focus-visible {
    color: var(--auth-primary);
    background: var(--auth-primary-soft);
    outline: none;
}

.auth-input-action svg {
    width: 18px;
    height: 18px;
}

/* An input group keeps its feedback message visible under the field */
.auth-input + .invalid-feedback,
.auth-input ~ .invalid-feedback {
    display: block;
}

.auth-link {
    color: var(--auth-primary);
    font-size: 0.825rem;
    font-weight: 600;
    text-decoration: none;
}

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

.auth-card .btn {
    height: 46px;
    border-radius: 10px;
    font-size: 0.925rem;
    font-weight: 600;
}

.auth-card .btn-primary {
    border-color: var(--auth-primary);
    background: var(--auth-primary);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--auth-primary) 30%, transparent);
}

.auth-card .btn-primary:hover,
.auth-card .btn-primary:focus {
    border-color: var(--auth-primary-dark);
    background: var(--auth-primary-dark);
}

.auth-card .btn-primary:disabled {
    opacity: 0.7;
}

.auth-btn-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border: 1px solid var(--auth-border);
    background: var(--auth-surface);
    color: var(--auth-text);
}

.auth-btn-social:hover,
.auth-btn-social:focus {
    border-color: var(--auth-primary);
    background: var(--auth-primary-soft);
    color: var(--auth-text);
}

.auth-btn-social svg {
    width: 20px;
    height: 20px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--auth-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.auth-alt {
    margin: 1.5rem 0 0;
    color: var(--auth-muted);
    font-size: 0.9rem;
    text-align: center;
}

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

.auth-alt a:hover {
    text-decoration: underline;
}

.auth-card .alert {
    border-radius: 10px;
    font-size: 0.875rem;
}

.auth-footer {
    color: var(--auth-muted);
    font-size: 0.8rem;
    text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .auth-topbar .navbar-collapse {
        order: 3;
        width: 100%;
    }

    .auth-topbar .navbar-nav {
        padding-top: 0.5rem;
        align-items: stretch !important;
    }
}

@media (max-width: 991.98px) {
    .auth-main {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .auth-topbar .navbar {
        padding: 0.65rem 1rem;
    }

    .auth-panel {
        padding: 1.5rem 1rem 1rem;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
        border-radius: 14px;
    }
}
