/* AppProLegal — Login elegante */
:root {
    --login-teal: #0d9488;
    --login-teal-light: #14b8a6;
    --login-teal-dark: #0f766e;
    --login-gold: #d4a853;
    --login-ink: #0f172a;
    --login-ink-soft: #1e293b;
    --login-muted: #64748b;
    --login-surface: #f8fafc;
    --login-card: #ffffff;
    --login-radius: 1.25rem;
    --login-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18);
    --login-shadow-lg: 0 32px 64px -16px rgba(15, 23, 42, 0.22);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.login-page {
    font-family: 'Outfit', system-ui, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--login-ink);
    background: var(--login-surface);
    -webkit-font-smoothing: antialiased;
}

/* Fondo decorativo */
.login-page__bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.login-page__bg-image {
    position: absolute;
    inset: 0;
    background: url('../../img/background.png') center / cover no-repeat;
    opacity: 0.35;
}

.login-page__bg-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(248, 250, 252, 0.92) 0%, rgba(241, 245, 249, 0.88) 45%, rgba(240, 253, 250, 0.9) 100%);
}

.login-page__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: login-orb-float 18s ease-in-out infinite;
}

.login-page__orb--1 {
    width: 420px;
    height: 420px;
    background: rgba(13, 148, 136, 0.35);
    top: -120px;
    right: -80px;
}

.login-page__orb--2 {
    width: 320px;
    height: 320px;
    background: rgba(212, 168, 83, 0.2);
    bottom: 10%;
    left: -60px;
    animation-delay: -6s;
}

.login-page__orb--3 {
    width: 260px;
    height: 260px;
    background: rgba(20, 184, 166, 0.25);
    top: 40%;
    left: 35%;
    animation-delay: -12s;
}

@keyframes login-orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(24px, -16px) scale(1.05); }
    66% { transform: translate(-16px, 12px) scale(0.96); }
}

/* Layout principal */
.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.login-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .login-layout {
        grid-template-columns: 1.05fr 0.95fr;
        min-height: calc(100dvh - 0px);
    }
}

@media (min-width: 1280px) {
    .login-layout {
        grid-template-columns: 1.15fr 0.85fr;
    }
}

/* Panel izquierdo — marca */
.login-hero {
    padding: 1.75rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .login-hero { padding: 2rem 2rem 1.75rem; }
}

@media (min-width: 1024px) {
    .login-hero {
        padding: 2.5rem 2.5rem 2rem 3rem;
        overflow-y: auto;
        max-height: 100dvh;
    }
}

.login-hero__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    animation: login-fade-up 0.7s ease-out both;
}

@media (min-width: 1024px) {
    .login-hero__brand {
        align-items: flex-start;
        text-align: left;
    }
}

.login-hero__logo {
    height: 5.5rem;
    width: auto;
    filter: drop-shadow(0 8px 24px rgba(15, 23, 42, 0.12));
}

@media (min-width: 640px) {
    .login-hero__logo { height: 6.5rem; }
}

@media (min-width: 1024px) {
    .login-hero__logo { height: 7rem; }
}

.login-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--login-teal-dark);
    background: rgba(13, 148, 136, 0.1);
    border: 1px solid rgba(13, 148, 136, 0.2);
}

.login-hero__badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--login-teal);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25);
    animation: login-pulse 2s ease-in-out infinite;
}

@keyframes login-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.login-hero__title {
    font-size: clamp(1.65rem, 4vw, 2.35rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--login-ink);
    max-width: 28rem;
}

.login-hero__title em {
    font-style: normal;
    background: linear-gradient(135deg, var(--login-teal) 0%, var(--login-teal-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.login-hero__subtitle {
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    line-height: 1.65;
    color: var(--login-muted);
    max-width: 36rem;
}

.login-hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: center;
    animation: login-fade-up 0.7s ease-out 0.1s both;
}

@media (min-width: 1024px) {
    .login-hero__stats { justify-content: flex-start; }
}

.login-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.85rem 0.5rem 0.5rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--login-ink-soft);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    line-height: 1.25;
}

.login-stat__icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.55rem;
    background: linear-gradient(145deg, rgba(13, 148, 136, 0.16) 0%, rgba(20, 184, 166, 0.1) 100%);
    color: var(--login-teal-dark);
    border: 1px solid rgba(13, 148, 136, 0.12);
}

.login-stat__icon svg {
    width: 1.05rem;
    height: 1.05rem;
    display: block;
    flex-shrink: 0;
}

.login-stat__label {
    line-height: 1.35;
    padding-right: 0.15rem;
}

/* Grid de módulos */
.login-modules {
    animation: login-fade-up 0.7s ease-out 0.2s both;
}

.login-modules__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.login-modules__title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--login-ink);
    letter-spacing: -0.02em;
}

.login-modules__hint {
    font-size: 0.72rem;
    color: var(--login-muted);
    text-align: right;
    max-width: 12rem;
    line-height: 1.4;
}

.login-modules__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

@media (min-width: 640px) {
    .login-modules__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

.login-module-card {
    display: flex;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: var(--login-radius);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.85);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.login-module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    border-color: rgba(13, 148, 136, 0.25);
}

.login-module-card__icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.65rem;
    background: linear-gradient(145deg, rgba(13, 148, 136, 0.12) 0%, rgba(20, 184, 166, 0.08) 100%);
    color: var(--login-teal-dark);
}

.login-module-card__icon svg {
    width: 1.15rem;
    height: 1.15rem;
}

.login-module-card__body h3 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--login-ink);
    margin: 0 0 0.2rem;
    line-height: 1.3;
}

.login-module-card__body p {
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--login-muted);
    margin: 0;
}

.login-module-card__body .tag-admin {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #b45309;
    background: rgba(251, 191, 36, 0.15);
    padding: 0.1rem 0.45rem;
    border-radius: 0.35rem;
}

/* Panel derecho — acceso */
.login-access {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

@media (min-width: 1024px) {
    .login-access {
        padding: 2rem 2.5rem 2rem 1.5rem;
        position: sticky;
        top: 0;
        max-height: 100dvh;
        overflow-y: auto;
    }
}

.login-access__inner {
    width: 100%;
    max-width: 420px;
    animation: login-fade-up 0.8s ease-out 0.15s both;
}

.login-card {
    background: var(--login-card);
    border-radius: 1.5rem;
    padding: 1.75rem 1.5rem;
    box-shadow: var(--login-shadow-lg);
    border: 1px solid rgba(226, 232, 240, 0.9);
    position: relative;
    overflow: hidden;
}

@media (min-width: 640px) {
    .login-card { padding: 2rem 2rem 1.75rem; }
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--login-teal) 0%, var(--login-teal-light) 50%, var(--login-gold) 100%);
}

.login-card__header {
    margin-bottom: 1.5rem;
}

.login-card__header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--login-ink);
    margin: 0 0 0.35rem;
}

.login-card__header p {
    font-size: 0.875rem;
    color: var(--login-muted);
    margin: 0;
    line-height: 1.5;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.login-error {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.85rem;
    line-height: 1.45;
}

.login-error svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.login-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--login-ink-soft);
    margin-bottom: 0.45rem;
}

.login-field__wrap {
    position: relative;
}

.login-field__wrap svg {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.1rem;
    height: 1.1rem;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s;
}

.login-field input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.65rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--login-ink);
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-field input::placeholder {
    color: #94a3b8;
}

.login-field input:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.login-field input:focus {
    outline: none;
    border-color: var(--login-teal);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}

.login-field input:focus + svg,
.login-field__wrap:focus-within svg {
    color: var(--login-teal);
}

.login-submit {
    margin-top: 0.35rem;
    width: 100%;
    padding: 0.95rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    background: linear-gradient(135deg, var(--login-teal) 0%, var(--login-teal-dark) 100%);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(13, 148, 136, 0.4);
    filter: brightness(1.03);
}

.login-submit:active {
    transform: translateY(0);
}

.login-submit svg {
    width: 1.1rem;
    height: 1.1rem;
    transition: transform 0.2s;
}

.login-submit:hover svg {
    transform: translateX(3px);
}

/* Footer contacto */
.login-footer {
    padding: 1.5rem 1.25rem 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    animation: login-fade-up 0.7s ease-out 0.3s both;
}

@media (min-width: 640px) {
    .login-footer { padding: 1.5rem 2rem 2.5rem; }
}

@media (min-width: 1024px) {
    .login-footer { padding: 0 2.5rem 2.5rem 3rem; }
}

@media (max-width: 1023px) {
    .login-shell {
        padding-bottom: 5.5rem;
    }
}

.login-footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .login-footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .login-footer__grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
}

.login-footer__item {
    display: flex;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border-radius: var(--login-radius);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.85);
    transition: border-color 0.2s;
}

.login-footer__item:hover {
    border-color: rgba(13, 148, 136, 0.2);
}

.login-footer__item-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: rgba(13, 148, 136, 0.1);
    color: var(--login-teal);
}

.login-footer__item-icon svg {
    width: 1rem;
    height: 1rem;
}

.login-footer__item h3 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--login-ink);
    margin: 0 0 0.2rem;
}

.login-footer__item p,
.login-footer__item a {
    font-size: 0.75rem;
    color: var(--login-muted);
    line-height: 1.45;
    text-decoration: none;
}

.login-footer__item a {
    color: var(--login-teal-dark);
    font-weight: 500;
    display: block;
    margin-top: 0.15rem;
}

.login-footer__item a:hover {
    color: var(--login-teal);
    text-decoration: underline;
}

/* Mobile: acceso rápido flotante */
.login-mobile-cta {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0));
    background: linear-gradient(to top, rgba(248, 250, 252, 0.98) 70%, transparent);
    backdrop-filter: blur(8px);
}

@media (min-width: 1024px) {
    .login-mobile-cta { display: none; }
}

.login-mobile-cta button {
    width: 100%;
    padding: 0.9rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    border: none;
    border-radius: 0.85rem;
    cursor: pointer;
    background: linear-gradient(135deg, var(--login-teal) 0%, var(--login-teal-dark) 100%);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.4);
}

/* Modal móvil refinado */
.login-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
}

.login-modal.is-open {
    display: flex;
}

@media (min-width: 640px) {
    .login-modal {
        align-items: center;
        padding: 1rem;
    }
}

.login-modal__sheet {
    width: 100%;
    max-width: 440px;
    max-height: 92dvh;
    overflow-y: auto;
    background: var(--login-card);
    border-radius: 1.5rem 1.5rem 0 0;
    box-shadow: var(--login-shadow-lg);
    animation: login-sheet-up 0.35s ease-out;
}

@media (min-width: 640px) {
    .login-modal__sheet {
        border-radius: 1.5rem;
        animation: login-fade-up 0.35s ease-out;
    }
}

@keyframes login-sheet-up {
    from { transform: translateY(100%); opacity: 0.8; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes login-fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-modal__handle {
    width: 2.5rem;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
    margin: 0.75rem auto 0;
}

@media (min-width: 640px) {
    .login-modal__handle { display: none; }
}

.login-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0;
}

.login-modal__head h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--login-ink);
}

.login-modal__close {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.5rem;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
}

.login-modal__close:hover {
    background: #e2e8f0;
    color: var(--login-ink);
}

.login-modal__body {
    padding: 1rem 1.25rem 1.5rem;
}

.login-modal__body .login-card {
    box-shadow: none;
    border: none;
    padding: 0;
}

.login-modal__body .login-card::before {
    display: none;
}

.login-modal__body .login-card__header {
    display: none;
}

/* Ocultar panel acceso en móvil (usa modal o scroll) */
@media (max-width: 1023px) {
    .login-access--desktop-only {
        display: none;
    }
}

@media (min-width: 1024px) {
    .login-mobile-cta { display: none !important; }
}
