*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: var(--ce-font-body); }

/* ─── ROOT LAYOUT ──────────────────────────────────────────── */

.auth-root {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #FFF8E7;
}

/* ─── LEFT PANEL ───────────────────────────────────────────── */

.auth-left {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    background: url('../images/auth-bg-new.jpg') no-repeat center center;
    background-size: cover;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(0,0,0,0.38) 0%, rgba(0,0,0,0.1) 60%, transparent 100%),
        linear-gradient(to top, rgba(107,16,16,0.45) 0%, transparent 45%);
    z-index: 0;
}

.auth-left__noise {
    position: absolute;
    inset: 0;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 128px;
    z-index: 0;
}


/* ─── LEFT: TOP (logo) ─────────────────────────────────────── */

.auth-left__content {
    position: relative;
    z-index: 1;
}

.auth-left__logo img {
    height: 160px;
}

/* ─── RIGHT: FORM LOGO ─────────────────────────────────────── */

.auth-form-logo {
    margin-bottom: 32px;
    text-align: center;
}

.auth-form-logo img {
    height: 110px;
    max-width: 100%;
    object-fit: contain;
}

/* ─── LEFT: BODY (headline) ────────────────────────────────── */

.auth-left__body {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 0 40px;
}

.auth-left__tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8B1A1A;
    background: rgba(139,26,26,0.08);
    border: 1px solid rgba(139,26,26,0.2);
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 24px;
}

.auth-left__headline {
    font-family: var(--ce-font-heading);
    font-size: clamp(2rem, 3.2vw, 3.4rem);
    font-weight: 700;
    line-height: 1.5;
    color: #fff;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 1px 3px rgba(0,0,0,0.8);
}

.auth-left__headline span {
    color: #FABD00;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.auth-left__sub {
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    font-weight: 500;
    color: rgba(255,255,255,0.88);
    line-height: 1.65;
    max-width: 420px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* ─── LEFT: FOOTER (stats) ─────────────────────────────────── */

.auth-left__footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    padding-right: 108px;
}

.auth-left__stats {
    display: flex;
    gap: clamp(16px, 2vw, 32px);
    flex-shrink: 0;
    background: rgba(0,0,0,0.28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 14px 20px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
}

.auth-stat__number {
    display: block;
    font-family: var(--ce-font-heading);
    font-size: clamp(1.2rem, 1.6vw, 1.6rem);
    font-weight: 700;
    color: #FABD00;
    letter-spacing: -0.02em;
}

.auth-stat__label {
    font-size: 0.68rem;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ─── TESTIMONIAL ───────────────────────────────────────────── */

.auth-testimonial {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 200px;
    flex-shrink: 1;
    min-width: 0;
}

.auth-testimonial__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    flex-shrink: 0;
}

.auth-testimonial__text {
    font-size: 0.75rem;
    color: #6B1010;
    line-height: 1.4;
}

.auth-testimonial__author {
    display: block;
    font-weight: 600;
    font-size: 0.7rem;
    margin-top: 3px;
    color: rgba(107,16,16,0.7);
}

/* ─── BADGES ───────────────────────────────────────────────── */

.auth-badge-marca {
    position: absolute;
    bottom: 48px;
    right: 48px;
    z-index: 50;
    width: 88px;
    display: block !important;
}

.auth-badge-marca img,
.auth-shield img {
    width: 100%;
    height: auto;
}

.auth-shield {
    position: absolute;
    bottom: 48px;
    left: 48px;
    z-index: 10;
    width: 100px;
}

/* ─── RIGHT PANEL ──────────────────────────────────────────── */

.auth-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #FFF8E7;
    padding: 48px 40px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* blob dorado — esquina superior derecha, igual que la landing */
.auth-right::before {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(250,189,0,0.28);
    pointer-events: none;
    z-index: 0;
}

/* blob rojo tenue — esquina inferior izquierda */
.auth-right::after {
    content: "";
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(139,26,26,0.07);
    pointer-events: none;
    z-index: 0;
}

.auth-form-wrap,
.auth-legal-footer {
    position: relative;
    z-index: 1;
}

/* ─── FORM CARD ────────────────────────────────────────────── */

.auth-form-wrap {
    width: 100%;
    max-width: 420px;
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(250,189,0,0.25);
    box-shadow:
        0 4px 6px rgba(139,26,26,0.04),
        0 12px 40px rgba(139,26,26,0.10),
        0 0 0 1px rgba(255,255,255,0.8) inset;
}

.auth-mobile-brand {
    display: none;
    margin-bottom: 24px;
    text-align: center;
}

.auth-mobile-brand__inner {
    display: inline-block;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    padding: 8px 16px;
    max-width: 100%;
}

.auth-mobile-brand img {
    height: auto;
    width: 100%;
    max-width: 260px;
    display: block;
    margin: 0 auto;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8B1A1A;
    text-decoration: none;
    margin-bottom: 28px;
    transition: color 0.15s;
}

.auth-back:hover { color: #6B1010; }

.auth-form-wrap__title {
    font-family: var(--ce-font-heading);
    font-size: 1.65rem;
    font-weight: 700;
    color: #6B1010;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
    text-align: center;
}

.auth-form-wrap__sub {
    font-size: 0.875rem;
    color: #9B7B6A;
    line-height: 1.6;
    margin-bottom: 32px;
    text-align: center;
}

/* ─── FORM FIELDS ──────────────────────────────────────────── */

.auth-field { margin-bottom: 18px; }

.auth-field__label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
}

.auth-field__label-row label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #5A3A2E;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0;
}

.auth-field__forgot-inline {
    font-size: 0.75rem;
    color: #9B7B6A;
    text-decoration: none;
    transition: color 0.15s;
    white-space: nowrap;
}

.auth-field__forgot-inline:hover { color: #8B1A1A; }

.auth-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #5A3A2E;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 7px;
}

.auth-field__input-wrap {
    position: relative;
}

.auth-field__input-wrap input {
    padding-right: 44px;
}

.auth-field__toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #9B7B6A;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.auth-field__toggle:hover { color: #8B1A1A; }
.auth-field__toggle svg { display: block; }

.auth-field input {
    width: 100%;
    padding: 12px 16px;
    background: #F7F4EE;
    border: 1.5px solid #E8DFD0;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #3D1A0E;
    font-family: var(--ce-font-body);
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    outline: none;
}

.auth-field input:focus {
    background: #fff;
    border-color: #C48B00;
    box-shadow: 0 0 0 3px rgba(250,189,0,0.18);
}

.auth-field input.is-invalid {
    border-color: #8B1A1A;
    background: #FFF5F5;
}

/* ─── ALERTS ───────────────────────────────────────────────── */

.auth-alert,
.auth-alert-danger {
    font-size: 0.83rem;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    background: #FFF0EE;
    color: #8B1A1A;
    border: 1px solid rgba(139,26,26,0.2);
}

.auth-alert-success {
    font-size: 0.83rem;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    background: #F0FAF4;
    color: var(--ce-success);
    border: 1px solid rgba(0,125,54,0.2);
}

/* ─── BUTTON ───────────────────────────────────────────────── */

.btn-signin {
    width: 100%;
    padding: 14px;
    background: #8B1A1A;
    color: #fff;
    font-family: var(--ce-font-body);
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
    box-shadow: 0 4px 16px rgba(139,26,26,0.28);
    margin-top: 8px;
}

.btn-signin:hover {
    background: #6B1010;
    box-shadow: 0 6px 24px rgba(139,26,26,0.38);
    transform: translateY(-1px);
}

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

.auth-forgot { display: none; }
.auth-forgot:hover { color: #8B1A1A; }

.auth-hint {
    font-size: 0.78rem;
    color: #9B7B6A;
    margin: 12px 0 16px;
    line-height: 1.5;
}

/* ─── DIVIDER & LANG ───────────────────────────────────────── */

.auth-divider {
    height: 1px;
    background: #EDE4D6;
    margin: 24px 0;
}

.auth-lang {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1.5px solid #E8DFD0;
    text-decoration: none;
    transition: all 0.15s;
}

.lang-btn--active {
    background: #FFF3C4;
    color: #8B1A1A;
    border-color: #C48B00;
}

.lang-btn--inactive {
    background: transparent;
    color: #9B7B6A;
    border-color: #E8DFD0;
}

.lang-btn--inactive:hover {
    color: #6B1010;
    border-color: #C48B00;
}

.lang-btn + .lang-btn { border-left: none; }
.lang-btn:first-child { border-radius: 20px; }
.lang-sep { display: none; }
.lang-btn img { vertical-align: middle; border-radius: 2px; }

/* ─── MOBILE HERO (< 768px) ────────────────────────────────── */

.auth-mobile-hero {
    display: none;
    background: linear-gradient(135deg, #FFE8A3 0%, #FFDCA0 100%);
    padding: 32px 28px 36px;
    border-radius: 20px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.auth-mobile-hero::before {
    content: '';
    position: absolute;
    bottom: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(250,189,0,0.4);
}

.auth-mobile-hero .auth-badge-marca {
    top: 16px;
    right: 16px;
    left: auto;
    bottom: auto;
    width: 48px;
    position: absolute;
}

.auth-mobile-brand {
    display: none;
}

.auth-mobile-headline {
    position: relative;
    z-index: 1;
    font-family: var(--ce-font-heading);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.4;
    color: #6B1010;
    margin-bottom: 16px;
    padding-top: 24px;
    text-align: center;
}

.auth-mobile-headline span {
    color: #FABD00;
    -webkit-text-stroke: 1px #C48B00;
    display: block;
    margin-top: 8px;
}

.auth-mobile-sub {
    position: relative;
    z-index: 1;
    font-size: 0.88rem;
    color: #7A3B2E;
    line-height: 1.6;
    max-width: 100%;
    text-align: center;
}

.auth-mobile-badges {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 2;
}

/* ─── BREAKPOINTS ──────────────────────────────────────────── */

@media (max-width: 1200px) {
    .auth-left { padding: 40px 36px; }
    .auth-badge-marca { width: 72px; bottom: 36px; right: 36px; }
    .auth-left__footer { padding-right: 92px; }
    .auth-testimonial { max-width: 180px; }
    .auth-testimonial__text { font-size: 0.72rem; }
}

@media (max-width: 900px) {
    .auth-left { padding: 32px 28px; }
    .auth-badge-marca { width: 60px; bottom: 28px; right: 28px; }
    .auth-left__footer { padding-right: 78px; gap: 12px; }
    .auth-left__stats  { gap: 16px; }
    .auth-testimonial  { max-width: 150px; }
    .auth-testimonial__avatar { width: 32px; height: 32px; }
    .auth-testimonial__text   { font-size: 0.68rem; }
    .auth-left__sub { max-width: 260px; }
}

@media (max-width: 768px) {
    .auth-root { grid-template-columns: 1fr; }
    .auth-left { display: none; }
    .auth-right {
        min-height: 100vh;
        padding: 40px 24px;
        justify-content: flex-start;
        padding-top: 48px;
    }
    .auth-form-wrap    { max-width: 100%; }
    .auth-mobile-hero  { display: block; }
    .auth-mobile-brand { display: block; margin-bottom: 24px; }
    .auth-form-logo    { display: none; }
}

@media (max-width: 480px) {
    .auth-right { padding: 32px 20px; }
    .auth-form-wrap__title { font-size: 1.4rem; }
    .btn-signin { padding: 15px; }
    .auth-field input { font-size: 0.9rem; }
    .auth-mobile-hero { padding: 20px 20px 28px; }
    .auth-mobile-headline { font-size: 1.5rem; padding-top: 64px; }
}

/* ─── LEGAL FOOTER ──────────────────────────────────────────── */

.auth-legal-footer {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    padding: 16px 0 4px;
    font-size: 0.78rem;
    color: #B8A898;
}

.auth-legal-footer a {
    color: #B8A898;
    text-decoration: none;
}

.auth-legal-footer a:hover {
    color: #6B1010;
    text-decoration: underline;
}

.auth-legal-footer span {
    color: #DDD3C5;
}
