/* Pantalla de autenticación — estilo SaaS moderno (split screen) */
/* Requiere que tokens.css esté enlazado antes que esta hoja de estilos. */

:root {
    --auth-purple-900: var(--dante-purple-900);
    --auth-purple-700: var(--dante-purple-700);
    --auth-violet-600: var(--dante-violet-600);
    --auth-violet-500: var(--dante-violet-500);
    --auth-blue-500: var(--dante-blue-500);
    --auth-pink-400: var(--dante-pink-400);

    --auth-white: var(--dante-white);
    --auth-gray-50: var(--dante-gray-50);
    --auth-gray-100: var(--dante-gray-100);
    --auth-gray-200: var(--dante-gray-200);
    --auth-gray-400: var(--dante-gray-400);
    --auth-gray-500: var(--dante-gray-500);
    --auth-gray-600: var(--dante-gray-600);
    --auth-gray-900: var(--dante-gray-900);

    --auth-radius-input: var(--dante-radius-input);
    --auth-radius-card: 28px;
    --auth-radius-pill: var(--dante-radius-pill);

    --auth-shadow-card: var(--dante-shadow-card);
    --auth-shadow-btn: var(--dante-shadow-btn);

    --auth-font: var(--dante-font);
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--auth-font);
    color: var(--auth-gray-900);
    -webkit-font-smoothing: antialiased;
}

.dante-auth {
    display: grid;
    grid-template-columns: 55fr 45fr;
    min-height: 100vh;
}

/* ---------- Columna izquierda: panel visual ---------- */

.dante-auth-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(40px, 6vw, 96px);
    background: linear-gradient(135deg, #3730a3 0%, #6d28d9 42%, #9333ea 70%, #db2777 100%);
    isolation: isolate;
}

.auth-visual-decor {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.auth-visual-decor::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.07) 0px,
        rgba(255, 255, 255, 0.07) 1px,
        transparent 1px,
        transparent 52px
    );
    opacity: 0.6;
}

.auth-shape {
    position: absolute;
    border-radius: var(--auth-radius-pill);
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02));
    animation: auth-drift 20s ease-in-out infinite alternate;
}

.auth-shape--bar-1 {
    width: 420px;
    height: 90px;
    top: 8%;
    right: -12%;
    transform: rotate(-18deg);
    animation-duration: 22s;
}

.auth-shape--bar-2 {
    width: 260px;
    height: 54px;
    bottom: 18%;
    left: -8%;
    transform: rotate(12deg);
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.01));
    animation-duration: 26s;
    animation-delay: -6s;
}

.auth-shape--bar-3 {
    width: 180px;
    height: 36px;
    top: 62%;
    right: 8%;
    transform: rotate(-30deg);
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
    animation-duration: 18s;
    animation-delay: -3s;
}

.auth-shape--circle-1 {
    width: 380px;
    height: 380px;
    top: -14%;
    left: -10%;
    background: radial-gradient(circle at 30% 30%, rgba(236, 72, 153, 0.55), rgba(236, 72, 153, 0) 70%);
    filter: blur(10px);
    animation-duration: 24s;
}

.auth-shape--circle-2 {
    width: 320px;
    height: 320px;
    bottom: -12%;
    right: -8%;
    background: radial-gradient(circle at 60% 40%, rgba(79, 70, 229, 0.55), rgba(79, 70, 229, 0) 70%);
    filter: blur(10px);
    animation-duration: 28s;
    animation-delay: -8s;
}

@keyframes auth-drift {
    from {
        transform: translate(0, 0) rotate(var(--auth-rot, 0deg)) scale(1);
    }
    to {
        transform: translate(18px, -14px) rotate(var(--auth-rot, 0deg)) scale(1.05);
    }
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    max-width: 560px;
}

.auth-visual-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--auth-white);
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 14px;
    text-transform: uppercase;
    opacity: 0;
    animation: auth-fade-in 0.8s ease-out 0.05s forwards;
}

.auth-visual-brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.auth-visual-eyebrow {
    display: inline-block;
    margin-top: 32px;
    padding: 8px 16px;
    border-radius: var(--auth-radius-pill);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: var(--auth-white);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0;
    animation: auth-fade-in 0.8s ease-out 0.18s forwards;
}

.auth-visual-title {
    margin-top: 24px;
    color: var(--auth-white);
    font-size: clamp(32px, 3.4vw, 48px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    opacity: 0;
    animation: auth-fade-in 0.8s ease-out 0.32s forwards;
}

.auth-visual-subtitle {
    margin-top: 20px;
    max-width: 460px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 17px;
    line-height: 1.6;
    opacity: 0;
    animation: auth-fade-in 0.8s ease-out 0.46s forwards;
}

.auth-visual-footer {
    position: absolute;
    left: clamp(40px, 6vw, 96px);
    bottom: clamp(28px, 4vw, 56px);
    z-index: 1;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    opacity: 0;
    animation: auth-fade-in 0.8s ease-out 0.6s forwards;
}

@keyframes auth-fade-in {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Columna derecha: formulario ---------- */

.dante-auth-form-panel {
    background: var(--auth-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: clamp(32px, 4vw, 48px) clamp(28px, 4vw, 40px);
    border-radius: var(--auth-radius-card);
    background: var(--auth-white);
    box-shadow: var(--auth-shadow-card);
    border: 1px solid rgba(15, 23, 42, 0.04);
    opacity: 0;
    animation: auth-card-in 0.7s ease-out 0.15s forwards;
}

@keyframes auth-card-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-card-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--auth-violet-600), var(--auth-blue-500));
    color: var(--auth-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 8px 16px -6px rgba(109, 40, 217, 0.55);
}

.auth-card-brand-name {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--auth-gray-600);
}

.auth-card h1 {
    margin-top: 28px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--auth-gray-900);
}

.auth-card-subtitle {
    margin-top: 8px;
    color: var(--auth-gray-500);
    font-size: 15px;
}

.auth-alert {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.auth-alert--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.auth-alert--success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.auth-form {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--auth-gray-600);
}

.auth-field-error {
    margin-top: -2px;
    font-size: 13px;
    color: #b91c1c;
}

.auth-field-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 420px) {
    .auth-field-row-2 {
        grid-template-columns: 1fr;
    }
}

.auth-input {
    width: 100%;
    padding: 13px 18px;
    font-family: inherit;
    font-size: 15px;
    color: var(--auth-gray-900);
    background: var(--auth-gray-50);
    border: 1.5px solid var(--auth-gray-200);
    border-radius: var(--auth-radius-input);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-input::placeholder {
    color: var(--auth-gray-400);
}

.auth-input:focus {
    border-color: var(--auth-violet-500);
    background: var(--auth-white);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.14);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--auth-gray-600);
    cursor: pointer;
}

.auth-checkbox {
    width: 17px;
    height: 17px;
    accent-color: var(--auth-violet-600);
    cursor: pointer;
}

.auth-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-violet-600);
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-submit {
    position: relative;
    margin-top: 6px;
    width: 100%;
    padding: 15px 20px;
    border: 0;
    border-radius: var(--auth-radius-pill);
    background: linear-gradient(135deg, var(--auth-violet-600), var(--auth-blue-500));
    color: var(--auth-white);
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: var(--auth-shadow-btn);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px -10px rgba(79, 70, 229, 0.6);
}

.auth-submit:active {
    transform: translateY(0) scale(0.98);
}

.auth-submit:disabled {
    cursor: not-allowed;
    opacity: 0.85;
    transform: none;
}

.auth-submit-spinner {
    display: none;
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--auth-white);
    border-radius: 50%;
}

.auth-submit.is-loading .auth-submit-label {
    visibility: hidden;
}

.auth-submit.is-loading .auth-submit-spinner {
    display: block;
    animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-card-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--auth-gray-100);
    text-align: center;
    font-size: 14px;
    color: var(--auth-gray-500);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    .dante-auth-visual {
        padding: clamp(32px, 5vw, 56px);
    }

    .auth-visual-title {
        font-size: clamp(26px, 4vw, 36px);
    }

    .auth-visual-subtitle {
        font-size: 15.5px;
    }

    .auth-shape--bar-1 {
        width: 300px;
        height: 64px;
    }

    .auth-shape--circle-1,
    .auth-shape--circle-2 {
        width: 240px;
        height: 240px;
    }
}

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

    .dante-auth-visual {
        display: none;
    }

    .dante-auth-form-panel {
        padding: 20px;
    }

    .auth-card {
        border-radius: 20px;
        box-shadow: 0 12px 30px -14px rgba(15, 23, 42, 0.2);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shape,
    .auth-visual-brand,
    .auth-visual-eyebrow,
    .auth-visual-title,
    .auth-visual-subtitle,
    .auth-visual-footer,
    .auth-card {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
