/* ============================================================
   Auth & Registration Pages – Full-Screen Premium Styles
   ============================================================ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
    --auth-primary: #0066C9;
    --auth-primary-dark: #004a94;
    --auth-primary-light: #e8f2ff;
    --auth-accent: #C23972;
    --auth-accent-dark: #a82e60;
    --auth-accent-light: #fceef4;
    --auth-bg: #f0f2f7;
    --auth-card-bg: #ffffff;
    --auth-text: #1b2138;
    --auth-text-subtle: #64748b;
    --auth-border: #e2e8f0;
    --auth-input-bg: #f8fafc;
    --auth-input-focus: #0066C9;
    --auth-radius: 20px;
    --auth-radius-sm: 12px;
    --auth-radius-xs: 8px;
    --auth-shadow: 0 20px 60px rgba(0,0,0,.10), 0 4px 16px rgba(0,0,0,.05);
    --auth-transition: .3s cubic-bezier(.4,0,.2,1);
}

/* ── Hide ALL chrome on auth pages (header, footer, nav) ───── */
/* Works for both main-wrapper and main-wrapper-simple layouts */
body:has(.auth-page) > #header,
body:has(.auth-page) > #header-simple,
body:has(.auth-page) > .brand_products__background-overlay,
body:has(.auth-page) > #brand_products {
    display: none !important;
}

/* Hide header-simple when it's inside the wrapper */
.main-wrapper-simple:has(.auth-page) > #header-simple,
.main-wrapper-simple:has(.auth-page) > header {
    display: none !important;
}

/* Hide breadcrumbs, banners, menus */
.main-wrapper:has(.auth-page) > .breadcrumbs,
.main-wrapper:has(.auth-page) > .busqueda-movil,
.main-wrapper:has(.auth-page) > .search-dropdown,
.main-wrapper:has(.auth-page) > .cartel-principal,
.main-wrapper:has(.auth-page) > #secondary-menu {
    display: none;
}

/* Hide ALL footers */
.main-wrapper:has(.auth-page) > footer,
.main-wrapper:has(.auth-page) > #footer,
.main-wrapper:has(.auth-page) > #footer-simple,
.main-wrapper-simple:has(.auth-page) > footer,
.main-wrapper-simple:has(.auth-page) > #footer,
.main-wrapper-simple:has(.auth-page) > #footer-simple {
    display: none !important;
}

/* Strip container/row/col padding (both wrapper types) */
.main-wrapper:has(.auth-page) > section,
.main-wrapper-simple:has(.auth-page) > section {
    margin: 0;
    padding: 0;
}

.main-wrapper:has(.auth-page) .container-fluid,
.main-wrapper-simple:has(.auth-page) .container-fluid {
    padding: 0 !important;
    max-width: none;
}

.main-wrapper:has(.auth-page) .container-fluid > .row,
.main-wrapper-simple:has(.auth-page) .container-fluid > .row {
    margin: 0;
}

.main-wrapper:has(.auth-page) .container-fluid .col-sm-12,
.main-wrapper-simple:has(.auth-page) .container-fluid .col-sm-12 {
    padding: 0;
}

/* ── Full-screen auth page ─────────────────────────────────── */
.auth-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
}

/* ── Full-screen card = two panels side by side ────────────── */
.auth-card {
    display: flex;
    width: 100%;
    flex: 1;
    max-width: none;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    text-align: left;
    background: var(--auth-card-bg);
    overflow: hidden;
}

/* ── Sidebar (left panel) ──────────────────────────────────── */
.auth-sidebar {
    flex: 0 0 42%;
    max-width: 580px;
    background: linear-gradient(160deg, #0b5394 0%, #083d6e 35%, #062a4e 100%);
    color: #fff;
    padding: 3.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 4.5rem;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Decorative circles */
.auth-sidebar::before {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(255,255,255,.07) 0%, transparent 70%);
    border-radius: 50%;
    top: -140px;
    right: -160px;
    pointer-events: none;
}

.auth-sidebar::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -100px;
    left: -100px;
    pointer-events: none;
}

/* Sidebar branding block */
.auth-sidebar__brand {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.auth-sidebar__brand-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 .35rem;
    letter-spacing: -.01em;
}

.auth-sidebar__brand-sub {
    font-size: 1rem;
    opacity: .7;
    margin: 0;
    font-weight: 400;
}

.auth-sidebar__item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    position: relative;
    z-index: 1;
    padding: .85rem 1rem;
    border-radius: var(--auth-radius-sm);
    transition: background var(--auth-transition);
}

.auth-sidebar__item:hover {
    background: rgba(255,255,255,.08);
}

.auth-sidebar__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--auth-radius-sm);
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.auth-sidebar__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 .2rem;
    line-height: 1.3;
    letter-spacing: .01em;
}

.auth-sidebar__desc {
    font-size: .92rem;
    opacity: .72;
    margin: 0;
    line-height: 1.45;
    font-weight: 400;
}

/* Accent sidebar variant (registration pages) */
.auth-sidebar--accent {
    background: linear-gradient(160deg, #b8336a 0%, #9a2d5a 35%, #7a2248 100%);
}

/* ── In-form logo (centered above heading) ────────────────── */
.auth-form__logo {
    display: block;
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-form__logo img {
    width: 160px;
    height: auto;
}

/* ── Form section (right panel) ────────────────────────────── */
.auth-form {
    flex: 1;
    padding: 3.5rem 4.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    background: var(--auth-card-bg);
}

/* Limit form width for readability */
.auth-form__inner {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

/* Registration forms need more width */
.auth-form--wide .auth-form__inner {
    max-width: 640px;
}

.auth-form__heading {
    font-size: 2.35rem;
    font-weight: 800;
    color: var(--auth-text);
    margin: 0 0 .35rem;
    letter-spacing: -.025em;
}

.auth-form__subheading {
    font-size: 1.05rem;
    color: var(--auth-text-subtle);
    margin: 0 0 2.25rem;
    font-weight: 400;
}

/* ── Form elements – Override formUtils output ─────────────── */
.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form label,
.auth-form .control-label,
.auth-form .label2 {
    display: block;
    font-size: .95rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: .4rem;
    letter-spacing: .01em;
}

.auth-form .form-control,
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form select,
.auth-form textarea {
    width: 100%;
    padding: .8rem 1.1rem;
    border-radius: var(--auth-radius-xs);
    border: 1.5px solid var(--auth-border);
    font-size: 1.05rem;
    color: var(--auth-text);
    background: var(--auth-input-bg);
    transition: border-color var(--auth-transition), box-shadow var(--auth-transition), background var(--auth-transition);
    outline: none;
    box-sizing: border-box;
    height: auto;
    line-height: 1.5;
    -webkit-appearance: none;
    appearance: none;
}

.auth-form .form-control:focus,
.auth-form input[type="text"]:focus,
.auth-form input[type="email"]:focus,
.auth-form input[type="password"]:focus,
.auth-form select:focus,
.auth-form textarea:focus {
    border-color: var(--auth-input-focus);
    box-shadow: 0 0 0 4px rgba(0, 102, 201, .10);
    background: #fff;
}

.auth-form .form-control::placeholder,
.auth-form input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

/* Select styling */
.auth-form select.form-control {
    cursor: pointer;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8.825L.35 3.175 1.4 2.1 6 6.7l4.6-4.6 1.05 1.075z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

/* ── Password field (formUtils compatibility) ──────────────── */
.auth-form .form-group > div[style*="display: flex"],
.auth-form .form-group > div[style*="display:flex"] {
    position: relative;
    display: flex !important;
    align-items: stretch;
}

.auth-form .form-group > div[style*="display: flex"] > input,
.auth-form .form-group > div[style*="display:flex"] > input {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    display: block !important;
}

.auth-form .form-group > div[style*="display: flex"] > .input-group-btn,
.auth-form .form-group > div[style*="display:flex"] > .input-group-btn {
    display: flex !important;
    align-items: stretch;
    width: auto !important;
    margin: 0 !important;
}

.auth-form .form-group > div[style*="display: flex"] > .input-group-btn .pwd-reveal,
.auth-form .form-group > div[style*="display:flex"] > .input-group-btn .pwd-reveal {
    border: 1.5px solid var(--auth-border);
    border-left: none;
    border-radius: 0 var(--auth-radius-xs) var(--auth-radius-xs) 0;
    background: var(--auth-input-bg);
    padding: 0 .85rem;
    cursor: pointer;
    color: var(--auth-text-subtle);
    transition: all var(--auth-transition);
    display: flex;
    align-items: center;
    margin: 0;
    height: auto;
}

.auth-form .form-group > div[style*="display: flex"] > .input-group-btn .pwd-reveal:hover,
.auth-form .form-group > div[style*="display:flex"] > .input-group-btn .pwd-reveal:hover {
    color: var(--auth-primary);
    background: var(--auth-primary-light);
    border-color: var(--auth-primary);
}

/* Replace glyphicon with FA icon via CSS */
.auth-form .pwd-reveal .glyphicon-eye-open::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f06e";
    -webkit-font-smoothing: antialiased;
}

.auth-form .pwd-reveal .glyphicon-eye-close::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f070";
    -webkit-font-smoothing: antialiased;
}

.auth-form .glyphicon {
    font-family: "Font Awesome 6 Free" !important;
    font-style: normal;
    font-weight: 900;
    font-size: 1rem;
}

/* Login page custom password toggle */
.auth-pwd-wrapper {
    position: relative;
}

.auth-pwd-wrapper input {
    padding-right: 3.25rem !important;
}

.auth-pwd-wrapper .auth-pwd-toggle {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--auth-text-subtle);
    font-size: 1.05rem;
    padding: .35rem;
    transition: color var(--auth-transition);
    line-height: 1;
}

.auth-pwd-wrapper .auth-pwd-toggle:hover {
    color: var(--auth-primary);
}

/* ── Checkbox (formUtils compatibility) ────────────────────── */
.auth-form .form-group .controls input[type="checkbox"].form-control {
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
    border-radius: 5px;
    border: 2px solid var(--auth-border);
    background: var(--auth-input-bg);
    cursor: pointer;
    accent-color: var(--auth-primary);
    -webkit-appearance: auto;
    appearance: auto;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.auth-form .form-group .controls {
    display: inline-block;
    margin-left: .15rem;
}

/* ── Links ─────────────────────────────────────────────────── */
.auth-link {
    font-size: .975rem;
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--auth-transition);
}

.auth-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.auth-forgot {
    display: inline-block;
    margin-bottom: 1.5rem;
}

/* ── Buttons ───────────────────────────────────────────────── */
.auth-btn {
    display: block;
    width: 100%;
    padding: .85rem 1.5rem;
    border-radius: var(--auth-radius-xs);
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all var(--auth-transition);
    border: 2px solid transparent;
    text-decoration: none !important;
    letter-spacing: .015em;
    line-height: 1.4;
}

.auth-btn--primary {
    background: linear-gradient(135deg, #0066C9 0%, #0050a0 100%);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(0,102,201,.25);
}

.auth-btn--primary:hover {
    background: linear-gradient(135deg, #0050a0 0%, #003d80 100%);
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,102,201,.35);
}

.auth-btn--accent {
    background: linear-gradient(135deg, #C23972 0%, #a82e60 100%);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(194,57,114,.25);
}

.auth-btn--accent:hover {
    background: linear-gradient(135deg, #a82e60 0%, #8f2650 100%);
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(194,57,114,.35);
}

.auth-btn--outline {
    background: transparent;
    color: var(--auth-primary) !important;
    border-color: var(--auth-primary);
}

.auth-btn--outline:hover {
    background: var(--auth-primary-light);
    color: var(--auth-primary-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,102,201,.12);
}

.auth-btn--outline-accent {
    background: transparent;
    color: var(--auth-accent) !important;
    border-color: var(--auth-accent);
}

.auth-btn--outline-accent:hover {
    background: var(--auth-accent-light);
    color: var(--auth-accent-dark) !important;
    transform: translateY(-2px);
}

.auth-btn--ghost {
    background: transparent;
    color: var(--auth-text-subtle) !important;
    border-color: transparent;
    font-weight: 600;
}

.auth-btn--ghost:hover {
    color: var(--auth-primary) !important;
    background: var(--auth-primary-light);
}

/* ── Button group spacing ──────────────────────────────────── */
.auth-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: .85rem;
    padding-top: 1.25rem;
}

/* ── Divider ───────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: .25rem 0;
    color: var(--auth-text-subtle);
    font-size: .92rem;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

/* ── Alert ─────────────────────────────────────────────────── */
.auth-alert {
    padding: .85rem 1rem;
    border-radius: var(--auth-radius-xs);
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.45;
}

.auth-alert--danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-alert--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.auth-form .alert-danger,
.auth-form .alert.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: var(--auth-radius-xs);
    padding: .85rem 1rem;
    font-size: 1rem;
}

/* Error state from formUtils */
.auth-form .help-inline {
    display: block;
    color: #dc2626;
    font-size: .92rem;
    margin-top: .3rem;
    font-weight: 500;
}

.auth-form .has-error .form-control,
.auth-form .has-error input,
.auth-form .has-error select {
    border-color: #fca5a5;
    background: #fff5f5;
}

.auth-form .has-error .form-control:focus,
.auth-form .has-error input:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239,68,68,.10);
}

.auth-form .has-error .control-label {
    color: #dc2626;
}

/* ── Fieldset / Sections ───────────────────────────────────── */
.auth-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 .5rem;
}

.auth-fieldset__legend {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--auth-primary);
    padding-bottom: .6rem;
    margin-bottom: 1.15rem;
    border-bottom: 2px solid var(--auth-border);
    width: 100%;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.auth-fieldset__legend i {
    font-size: 1.05rem;
    opacity: .8;
}

/* Grid helpers */
.auth-grid {
    display: grid;
    gap: .25rem 1.25rem;
}

.auth-grid--2 {
    grid-template-columns: 1fr 1fr;
}

.auth-grid--3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.auth-grid--2-1 {
    grid-template-columns: 2fr 1fr;
}

/* ── Switch banner (link to other registration type) ───────── */
.auth-switch-banner {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .85rem 1.35rem;
    border-radius: var(--auth-radius-xs);
    background: linear-gradient(90deg, #fff7ed, #fffbf5);
    color: #9a3412;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none !important;
    border: 1.5px solid #fed7aa;
    transition: all var(--auth-transition);
    margin-bottom: 1.75rem;
}

.auth-switch-banner i {
    font-size: 1rem;
    opacity: .75;
}

.auth-switch-banner:hover {
    background: linear-gradient(90deg, #ffedd5, #fff7ed);
    border-color: #fdba74;
    color: #9a3412;
    transform: translateX(4px);
}

/* ── reCAPTCHA container ───────────────────────────────────── */
.auth-captcha {
    margin: .75rem 0 1.5rem;
}

.auth-captcha .g-recaptcha {
    margin: 0;
    padding: 0;
}

/* ── Security badge ────────────────────────────────────────── */
.auth-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-size: .88rem;
    color: var(--auth-text-subtle);
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--auth-border);
}

.auth-security-note i {
    color: #22c55e;
    font-size: 1rem;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
    .auth-sidebar {
        display: none;
    }

    /* Show site header on mobile for navigation */
    .main-wrapper-simple:has(.auth-page) > #header-simple,
    .main-wrapper-simple:has(.auth-page) > header,
    body:has(.auth-page) > #header,
    body:has(.auth-page) > #header-simple {
        display: flex !important;
    }

    /* Hide in-form logo on mobile (header is visible instead) */
    .auth-form__logo {
        display: none;
    }

    .auth-page {
        min-height: calc(100vh - 80px);
    }

    .auth-form {
        padding: 2.5rem 2rem;
        min-height: calc(100vh - 80px);
    }
}

@media (max-width: 640px) {
    .auth-form {
        padding: 2rem 1.25rem;
    }

    .auth-form__heading {
        font-size: 1.5rem;
    }

    .auth-grid--2,
    .auth-grid--3,
    .auth-grid--2-1 {
        grid-template-columns: 1fr;
    }

    .auth-switch-banner {
        font-size: .84rem;
    }
}

@media (max-width: 400px) {
    .auth-form {
        padding: 1.5rem 1rem;
    }
}
