/* Estilos comunes de las páginas de acceso (login, registro). */
:root {
    --lg-navy: #233b66;
    --lg-navy-dark: #1a2c4d;
    --lg-ink: #1f2a3d;
    --lg-muted: #6d7a93;
    --lg-border: #d6dde9;
}
body {
    margin: 0;
    min-height: 100vh;
    background: #e9eaeb url('/imagenes/fondo3.jpg') no-repeat center center fixed;
    background-size: cover;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.min-h-screen { background: transparent !important; }

.lg-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}
.lg-shell {
    width: 100%;
    max-width: 980px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(31, 42, 61, .18);
}

/* Panel de marca */
.lg-brand {
    position: relative;
    background: linear-gradient(150deg, #2f4f86 0%, var(--lg-navy) 45%, var(--lg-navy-dark) 100%);
    color: #fff;
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.lg-brand::after {
    content: '';
    position: absolute;
    right: -120px;
    bottom: -120px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    border: 44px solid rgba(255, 255, 255, .06);
    pointer-events: none;
}
.lg-logo { display: inline-flex; flex-direction: column; align-items: flex-start; }
.lg-logo-mi {
    background: #fff;
    color: var(--lg-navy);
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1;
    padding: 5px 7px 6px;
    border-radius: 6px;
    margin-bottom: 4px;
}
.lg-logo img { width: 210px; height: auto; display: block; }
.lg-brand h2 {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 40px 0 12px;
}
.lg-brand > p { color: rgba(255, 255, 255, .78); font-size: .98rem; line-height: 1.6; margin: 0 0 28px; }
.lg-features { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: 14px; }
.lg-features li { display: flex; align-items: center; gap: 12px; font-size: .95rem; color: rgba(255, 255, 255, .92); }
.lg-features i {
    width: 34px; height: 34px; flex: 0 0 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .12);
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
}
.lg-brand-foot { margin-top: 36px; font-size: .82rem; color: rgba(255, 255, 255, .55); }

/* Panel del formulario */
.lg-form-panel { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.lg-back {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--lg-muted);
    text-decoration: none;
    font-size: .9rem;
    margin-bottom: 26px;
}
.lg-back:hover { color: var(--lg-navy); }
.lg-form-panel h1 { font-size: 1.75rem; font-weight: 700; color: var(--lg-ink); margin: 0 0 6px; }
.lg-sub { color: var(--lg-muted); margin: 0 0 26px; font-size: .97rem; }

.lg-alert { border-radius: 12px; font-size: .92rem; padding: 12px 14px; }

.lg-field { margin-bottom: 18px; }
.lg-label { display: block; font-size: .85rem; font-weight: 600; color: var(--lg-ink); margin-bottom: 7px; }
.lg-input-wrap { position: relative; }
.lg-input-wrap > i {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: var(--lg-muted); font-size: 1rem; pointer-events: none;
}
.lg-input {
    width: 100%;
    min-height: 50px;
    padding: 12px 46px 12px 44px;
    border: 1.5px solid var(--lg-border);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--lg-ink);
    background: #fbfcfe;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.lg-input::placeholder { color: #a3adbf; }
.lg-input:focus { border-color: #2f4f86; background: #fff; box-shadow: 0 0 0 4px rgba(47, 79, 134, .14); }
.lg-input-wrap:focus-within > i { color: var(--lg-navy); }
.lg-input.is-invalid { border-color: #dc3545; background: #fffafa; }
.lg-error { display: flex; gap: 6px; align-items: flex-start; color: #c02c3b; font-size: .86rem; margin-top: 7px; }
.lg-eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; border: 0; border-radius: 10px;
    background: transparent; color: var(--lg-muted);
}
.lg-eye:hover, .lg-eye:focus-visible { background: #eef2f8; color: var(--lg-navy); }

.lg-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 22px; flex-wrap: wrap; }
.lg-row .form-check { margin: 0; display: flex; align-items: center; gap: 8px; padding-left: 0; }
.lg-row .form-check-input { margin: 0; width: 18px; height: 18px; cursor: pointer; }
.lg-row .form-check-input:checked { background-color: var(--lg-navy); border-color: var(--lg-navy); }
.lg-row .form-check-label { color: #4a5568; font-size: .93rem; cursor: pointer; }
.lg-link { color: #2f4f86; font-weight: 600; font-size: .93rem; text-decoration: none; }
.lg-link:hover { color: var(--lg-navy-dark); text-decoration: underline; }

.lg-submit {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 12px;
    background: var(--lg-navy);
    color: #fff;
    font-size: 1.02rem;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 10px 22px rgba(35, 59, 102, .25);
    transition: background .2s ease, transform .15s ease;
}
.lg-submit:hover { background: var(--lg-navy-dark); transform: translateY(-1px); }
.lg-submit:disabled { opacity: .75; transform: none; }

.lg-divider { display: flex; align-items: center; gap: 12px; color: #a3adbf; font-size: .82rem; margin: 26px 0 18px; }
.lg-divider::before, .lg-divider::after { content: ''; flex: 1; height: 1px; background: #e4e9f2; }

.lg-secondary { display: grid; gap: 10px; }
.lg-secondary-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 46px;
    border: 1.5px solid var(--lg-border);
    border-radius: 12px;
    color: var(--lg-navy);
    font-weight: 600;
    font-size: .94rem;
    text-decoration: none;
    background: #fff;
    transition: border-color .2s ease, background .2s ease;
}
.lg-secondary-btn:hover { border-color: #2f4f86; background: #f5f8fd; color: var(--lg-navy); }
.lg-small { text-align: center; color: var(--lg-muted); font-size: .86rem; margin-top: 18px; }
.lg-small a { color: #2f4f86; font-weight: 600; text-decoration: none; }
.lg-small a:hover { text-decoration: underline; }

/* Tablet y móvil: una columna; el panel de marca pasa a ser una cabecera compacta */
@media (max-width: 860px) {
    .lg-page { padding: 20px 16px; }
    .lg-shell { grid-template-columns: 1fr; max-width: 480px; border-radius: 20px; }
    .lg-brand { padding: 22px 24px; flex-direction: row; align-items: center; justify-content: space-between; }
    .lg-brand::after { width: 180px; height: 180px; right: -70px; bottom: -90px; border-width: 30px; }
    .lg-logo img { width: 150px; }
    .lg-logo-mi { font-size: .95rem; }
    .lg-brand h2, .lg-brand > p, .lg-features, .lg-brand-foot { display: none; }
    .lg-form-panel { padding: 26px 24px 30px; }
    .lg-back { margin-bottom: 18px; }
    .lg-form-panel h1 { font-size: 1.5rem; }
    .lg-sub { margin-bottom: 22px; }
}
@media (max-width: 576px) {
    /* Hueco abajo para que el botón de idioma no tape el último enlace */
    .lg-page { padding-bottom: 84px; align-items: flex-start; }
    .lg-row .form-check-label, .lg-link { font-size: .88rem; }
}
@media (max-width: 380px) {
    .lg-form-panel { padding: 22px 18px 26px; }
    .lg-row { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    .lg-submit, .lg-input { transition: none; }
    .lg-submit:hover { transform: none; }
}

/* ---------- Registro ---------- */
.lg-steps { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: 16px; counter-reset: paso; }
.lg-steps li { display: flex; align-items: flex-start; gap: 12px; color: rgba(255, 255, 255, .92); font-size: .95rem; line-height: 1.45; }
.lg-steps li::before {
    counter-increment: paso;
    content: counter(paso);
    width: 30px; height: 30px; flex: 0 0 30px;
    border-radius: 50%;
    background: #fff;
    color: var(--lg-navy);
    font-weight: 700;
    font-size: .9rem;
    display: flex; align-items: center; justify-content: center;
}
.lg-steps strong { display: block; color: #fff; }
.lg-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: .85rem;
    font-weight: 600;
    margin: 0 0 22px;
    align-self: flex-start;
}

.lg-phone { display: grid; grid-template-columns: minmax(118px, 40%) 1fr; gap: 10px; }
.lg-phone .lg-input { padding-left: 14px; }

/* Select2 del prefijo con el mismo aspecto que los campos */
.lg-phone .select2-container { width: 100% !important; }
.lg-phone .select2-container--bootstrap4 .select2-selection--single {
    min-height: 50px !important;
    height: 50px !important;
    border: 1.5px solid var(--lg-border) !important;
    border-radius: 12px !important;
    background: #fbfcfe !important;
    display: flex; align-items: center;
    padding: 0 34px 0 12px !important;
}
.lg-phone .select2-container--bootstrap4.select2-container--focus .select2-selection--single,
.lg-phone .select2-container--bootstrap4.select2-container--open .select2-selection--single {
    border-color: #2f4f86 !important;
    box-shadow: 0 0 0 4px rgba(47, 79, 134, .14) !important;
    background: #fff !important;
}
.lg-phone .select2-container--bootstrap4 .select2-selection__rendered {
    line-height: 1.3 !important;
    padding: 0 !important;
    color: var(--lg-ink) !important;
    font-size: .98rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lg-phone .select2-container--bootstrap4 .select2-selection__arrow { position: absolute; top: 50% !important; transform: translateY(-50%); height: 20px !important; right: 10px !important; }
.lg-phone.is-invalid .select2-selection--single { border-color: #dc3545 !important; }
.select2-container--bootstrap4 .select2-dropdown { border-radius: 12px; border-color: var(--lg-border); overflow: hidden; box-shadow: 0 12px 30px rgba(31, 42, 61, .15); }
.select2-container--bootstrap4 .select2-search--dropdown .select2-search__field { border-radius: 10px; padding: 8px 10px; }
.select2-container--bootstrap4 .select2-results__option { padding: 9px 12px; }
.select2-container--bootstrap4 .select2-results__option--highlighted { background: var(--lg-navy) !important; }

.lg-reqs { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.lg-reqs li { display: flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--lg-muted); }
.lg-reqs li i { width: 14px; text-align: center; font-size: .78rem; color: #b5bfd0; }
.lg-reqs li.ok { color: #15803d; }
.lg-reqs li.ok i { color: #16a34a; }
.lg-match { font-size: .84rem; margin-top: 7px; display: none; align-items: center; gap: 6px; }
.lg-match.ok { display: flex; color: #15803d; }
.lg-match.bad { display: flex; color: #c02c3b; }

.lg-legal { font-size: .82rem; color: var(--lg-muted); text-align: center; margin: 14px 0 0; }
.lg-legal i { color: #2f4f86; }

@media (max-width: 860px) {
    .lg-steps, .lg-badge { display: none; }
}
@media (max-width: 420px) {
    .lg-reqs { grid-template-columns: 1fr; }
}
@media (max-width: 330px) {
    .lg-phone { grid-template-columns: 1fr; }
}

/* ---------- Portal de distribuidores (variante profesional: oscuro + dorado) ---------- */
body.lg-pro-body {
    background: radial-gradient(1200px 600px at 15% 10%, #24395f 0%, transparent 60%),
                radial-gradient(900px 500px at 90% 90%, #3a2f12 0%, transparent 55%),
                #0d1626;
}
.lg-pro {
    --lg-gold: #f2b544;
    --lg-gold-dark: #d99a22;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .45);
}
.lg-pro .lg-brand {
    background: linear-gradient(160deg, #1b2b47 0%, #111d33 55%, #0b1424 100%);
}
.lg-pro .lg-brand::after { border-color: rgba(242, 181, 68, .10); }
.lg-pro .lg-brand::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--lg-gold), rgba(242, 181, 68, 0));
}
.lg-pro .lg-logo-mi { background: var(--lg-gold); color: #111d33; }
.lg-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--lg-gold);
    font-size: .78rem; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
    margin: 36px 0 0;
}
.lg-pro .lg-brand h2 { margin-top: 10px; }
.lg-pro .lg-features i { background: rgba(242, 181, 68, .14); color: var(--lg-gold); }
.lg-pro .lg-brand-foot a { color: rgba(255, 255, 255, .75); }

.lg-pill {
    display: inline-flex; align-items: center; gap: 7px;
    align-self: flex-start;
    background: #fff6e3;
    color: #8a5a00;
    border: 1px solid #f6dca6;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: .8rem; font-weight: 700;
    margin-bottom: 14px;
}
.lg-pro .lg-input:focus { border-color: var(--lg-gold-dark); box-shadow: 0 0 0 4px rgba(242, 181, 68, .2); }
.lg-pro .lg-input-wrap:focus-within > i { color: var(--lg-gold-dark); }
.lg-pro .lg-submit { background: #111d33; box-shadow: 0 10px 22px rgba(17, 29, 51, .3); }
.lg-pro .lg-submit:hover { background: #0b1424; }
.lg-pro .lg-submit i { color: var(--lg-gold); }
.lg-help {
    display: flex; gap: 12px; align-items: flex-start;
    background: #f7f9fc;
    border: 1px solid #e4e9f2;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: .86rem;
    color: var(--lg-muted);
    margin-top: 18px;
}
.lg-help i { color: var(--lg-gold-dark); margin-top: 2px; }
.lg-help strong { color: var(--lg-ink); }

@media (max-width: 860px) {
    .lg-pro .lg-brand::before { width: 100%; height: 3px; bottom: auto; background: linear-gradient(90deg, var(--lg-gold), rgba(242, 181, 68, 0)); }
    .lg-eyebrow { display: none; }
    .lg-brand-tag {
        display: inline-flex !important; align-items: center; gap: 6px;
        color: var(--lg-gold); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
        position: relative; z-index: 1;
    }
}
.lg-brand-tag { display: none; }

/* ---------- Variante de una columna (recuperar contraseña, reenviar verificación) ---------- */
.lg-single { grid-template-columns: 1fr; max-width: 480px; }
.lg-single .lg-brand { padding: 22px 28px; flex-direction: row; align-items: center; justify-content: space-between; }
.lg-single .lg-brand::after { width: 180px; height: 180px; right: -70px; bottom: -90px; border-width: 30px; }
.lg-single .lg-logo img { width: 150px; }
.lg-single .lg-logo-mi { font-size: .95rem; }
.lg-single .lg-form-panel { padding: 30px 32px 34px; }
.lg-hero-icon {
    width: 60px; height: 60px;
    border-radius: 18px;
    background: #eef2f8;
    color: var(--lg-navy);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}
.lg-hero-icon.ok { background: #ecfdf3; color: #15803d; }
.lg-done {
    display: flex; gap: 12px; align-items: flex-start;
    background: #ecfdf3; border: 1px solid #bbf7d0; color: #166534;
    border-radius: 12px; padding: 14px 16px; font-size: .92rem; margin-bottom: 18px;
}
.lg-done i { margin-top: 3px; }
.lg-tips { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.lg-tips li { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--lg-muted); }
.lg-tips li i { color: #2f4f86; margin-top: 3px; width: 14px; text-align: center; }
@media (max-width: 576px) {
    .lg-single .lg-form-panel { padding: 24px 22px 28px; }
}

/* Botón principal en versión secundaria (cuando hay otra acción más importante) */
.lg-submit.lg-alt { background: #fff; color: var(--lg-navy); border: 1.5px solid var(--lg-border); box-shadow: none; }
.lg-submit.lg-alt:hover { background: #f5f8fd; border-color: #2f4f86; transform: none; }
