/**
 * auth.css — Estilos Modernos para Login y Recuperación de Clave (IntelligentID)
 * AkaromSoft S.R.L - Compatible con Modo Claro / Oscuro y 4 Skins Dinámicos
 */

/* ═══════════════════════════════════════════════════════════════════════════
   RESET Y CONTENEDOR GENERAL
   ═══════════════════════════════════════════════════════════════════════════ */
html, body {
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body.auth-body,
.auth-body {
    min-height: 100vh;
    font-family: var(--font-family-sans-serif, 'Inter', system-ui, -apple-system, sans-serif);
    background: radial-gradient(circle at 10% 20%, rgba(var(--ds-primary-rgb, 26, 126, 251), 0.08) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(var(--ds-primary-rgb, 26, 126, 251), 0.05) 0%, transparent 40%),
                var(--ds-surface-subtle, #f1f5f9) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
    width: 100%;
}

[data-bs-theme="dark"] body.auth-body,
[data-bs-theme="dark"] .auth-body {
    background: radial-gradient(circle at 10% 20%, rgba(var(--ds-primary-rgb, 26, 126, 251), 0.12) 0%, transparent 45%),
                radial-gradient(circle at 90% 80%, rgba(var(--ds-primary-rgb, 26, 126, 251), 0.08) 0%, transparent 45%),
                #0b1320 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SHELL DE DOS COLUMNAS
   ═══════════════════════════════════════════════════════════════════════════ */
.shell {
    display: flex;
    width: 100%;
    max-width: 880px;
    min-height: 540px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.09), 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--ds-border, #e2e8f0);
    overflow: hidden;
    animation: shellIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
    background: var(--ds-surface-card, #ffffff);
    margin: auto;
}

[data-bs-theme="dark"] .shell {
    background: #141e2e;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

@keyframes shellIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PANEL IZQUIERDO — HERO
   ═══════════════════════════════════════════════════════════════════════════ */
.panel-hero {
    flex: 1.1;
    background: var(--ds-primary-gradient, linear-gradient(145deg, #1a7efb 0%, #1052c2 100%));
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px 38px;
    position: relative;
    overflow: hidden;
}

.panel-hero::before,
.panel-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.panel-hero::before {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 70%);
    top: -80px;
    right: -100px;
}

.panel-hero::after {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
    bottom: -80px;
    left: -80px;
}

.hero-logo {
    width: 58px;
    height: 58px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hero-logo img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.16);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 14px;
    width: fit-content;
}

.hero-tag-dot {
    width: 7px;
    height: 7px;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 6px #34d399;
}

.hero-title {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 14px 0;
    color: #ffffff;
}

.hero-title span {
    font-weight: 300;
    opacity: 0.9;
}

.hero-desc {
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.5;
    margin-bottom: 20px;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.92);
}

.feature-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 14px;
    height: 14px;
    color: #ffffff;
}

.hero-by {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.02em;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PANEL DERECHO — FORMULARIO
   ═══════════════════════════════════════════════════════════════════════════ */
.panel-form {
    flex: 1;
    width: 410px;
    max-width: 100%;
    flex-shrink: 0;
    background: var(--ds-surface-card, #ffffff);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 38px 34px;
    box-sizing: border-box;
}

[data-bs-theme="dark"] .panel-form {
    background: #141e2e;
}

.avatar-wrap {
    position: relative;
    margin-bottom: 12px;
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--ds-surface-subtle, #f1f5f9);
    border: 2.5px solid var(--ds-border, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-bs-theme="dark"] .avatar {
    background: #1e293b;
    border-color: #334155;
}

.avatar svg {
    width: 34px;
    height: 34px;
    color: var(--ds-text-subtle, #94a3b8);
}

[data-bs-theme="dark"] .avatar svg {
    color: #64748b;
}

.avatar-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 13px;
    height: 13px;
    background: var(--ds-primary, #1a7efb);
    border-radius: 50%;
    border: 2px solid var(--ds-surface-card, #ffffff);
}

[data-bs-theme="dark"] .avatar-dot {
    border-color: #141e2e;
}

.form-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ds-text-main, #1e293b);
    text-align: center;
    margin: 0;
}

[data-bs-theme="dark"] .form-title {
    color: #f1f5f9;
}

.form-sub {
    font-size: 0.8rem;
    color: var(--ds-text-muted, #64748b);
    text-align: center;
    margin-top: 3px;
    margin-bottom: 20px;
}

[data-bs-theme="dark"] .form-sub {
    color: #94a3b8;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMULARIO E INPUTS
   ═══════════════════════════════════════════════════════════════════════════ */
.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Honeypot anti-spam: COMPLETAMENTE INVISIBLE */
.honeypot-field {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.input-wrap {
    display: flex;
    align-items: center;
    background: var(--ds-surface-subtle, #f8faff);
    border: 1.5px solid var(--ds-border, #e2e8f0);
    border-radius: 11px;
    height: 46px;
    padding: 0 12px;
    gap: 8px;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    box-sizing: border-box;
    width: 100%;
}

[data-bs-theme="dark"] .input-wrap {
    background: #0d1522;
    border-color: #273549;
}

.input-wrap:focus-within {
    border-color: var(--ds-primary, #1a7efb);
    box-shadow: 0 0 0 3px rgba(var(--ds-primary-rgb, 26, 126, 251), 0.18);
    background: var(--ds-surface-card, #ffffff);
}

[data-bs-theme="dark"] .input-wrap:focus-within {
    background: #111a28;
    border-color: var(--ds-primary, #1a7efb);
}

.input-icon {
    color: var(--ds-text-subtle, #94a3b8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.input-icon svg {
    width: 17px !important;
    height: 17px !important;
    max-width: 17px !important;
    max-height: 17px !important;
}

.input-wrap input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 0.88rem;
    color: var(--ds-text-main, #1e293b);
    font-family: inherit;
    outline: none !important;
    width: 100%;
    box-shadow: none !important;
}

[data-bs-theme="dark"] .input-wrap input {
    color: #f1f5f9;
}

.input-wrap input::placeholder {
    color: var(--ds-text-subtle, #94a3b8);
    font-size: 0.85rem;
}

[data-bs-theme="dark"] .input-wrap input::placeholder {
    color: #556987;
}

.input-action {
    padding: 4px;
    color: var(--ds-text-subtle, #94a3b8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    transition: color 0.15s;
    border-radius: 6px;
}

.input-action:hover {
    color: var(--ds-primary, #1a7efb);
}

.input-action svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 4px;
}

.check-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--ds-primary, #1a7efb);
    cursor: pointer;
    margin: 0;
}

.check-row label {
    font-size: 0.82rem;
    color: var(--ds-text-muted, #64748b);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    margin: 0;
}

[data-bs-theme="dark"] .check-row label {
    color: #94a3b8;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTONES
   ═══════════════════════════════════════════════════════════════════════════ */
.btn-primary-form {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    border: none;
    border-radius: 12px;
    background: var(--ds-primary-gradient, linear-gradient(135deg, #1a7efb 0%, #1052c2 100%));
    color: #ffffff !important;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.18s, transform 0.15s, box-shadow 0.18s;
    box-shadow: 0 4px 14px rgba(var(--ds-primary-rgb, 26, 126, 251), 0.35);
    margin-top: 4px;
    text-decoration: none !important;
    box-sizing: border-box;
}

.btn-primary-form:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--ds-primary-rgb, 26, 126, 251), 0.45);
    color: #ffffff !important;
}

.btn-primary-form:active {
    transform: none;
}

/* Ícono SVG dentro del botón con tamaño controlado estrictamente */
.auth-btn-svg,
.btn-primary-form svg,
.btn-ghost-form svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    vertical-align: middle !important;
    color: inherit;
}

.btn-ghost-form {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    border: 1.5px solid var(--ds-border, #e2e8f0);
    border-radius: 10px;
    background: var(--ds-surface, #ffffff);
    color: var(--ds-text-muted, #64748b) !important;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: border-color 0.18s, color 0.18s, background 0.18s;
    text-decoration: none !important;
    box-sizing: border-box;
}

[data-bs-theme="dark"] .btn-ghost-form {
    background: #0d1522;
    border-color: #273549;
    color: #94a3b8 !important;
}

.btn-ghost-form:hover {
    border-color: var(--ds-primary, #1a7efb);
    color: var(--ds-primary, #1a7efb) !important;
    background: var(--ds-surface-hover, #f0f7ff);
}

[data-bs-theme="dark"] .btn-ghost-form:hover {
    background: #19263a;
    border-color: var(--ds-primary, #1a7efb);
    color: #60a5fa !important;
}

.spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-primary-form.loading .btn-text,
.btn-primary-form.loading .auth-btn-svg,
.btn-primary-form.loading svg {
    display: none !important;
}

.btn-primary-form.loading .spinner {
    display: block !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .shell {
        flex-direction: column;
        max-width: 440px;
        min-height: unset;
    }
    .panel-hero {
        padding: 30px 24px 26px;
    }
    .hero-logo {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        margin-bottom: 16px;
    }
    .hero-logo img {
        width: 32px;
        height: 32px;
    }
    .hero-title {
        font-size: 1.5rem;
    }
    .hero-by {
        margin-top: 18px;
    }
    .panel-form {
        width: 100%;
        padding: 28px 22px 32px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SWEETALERT2 — TEMA MODERNO AKAROM
   ═══════════════════════════════════════════════════════════════════════════ */
.swal2-popup,
.swal2-auth-popup {
    border-radius: 20px !important;
    padding: 2rem 1.8rem !important;
    background: var(--ds-surface-card, #ffffff) !important;
    color: var(--ds-text-main, #1e293b) !important;
    font-family: inherit !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--ds-border, #e2e8f0) !important;
    border: none !important;
}

[data-bs-theme="dark"] .swal2-popup,
[data-bs-theme="dark"] .swal2-auth-popup {
    background: #141e2e !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

.swal2-title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: var(--ds-text-main, #1e293b) !important;
    margin: 0.5rem 0 0.4rem 0 !important;
    padding: 0 !important;
}

[data-bs-theme="dark"] .swal2-title {
    color: #f1f5f9 !important;
}

.swal2-html-container {
    font-size: 0.88rem !important;
    color: var(--ds-text-muted, #64748b) !important;
    line-height: 1.5 !important;
    margin: 0.25rem 0 1rem 0 !important;
}

[data-bs-theme="dark"] .swal2-html-container {
    color: #94a3b8 !important;
}

.swal2-icon {
    margin: 0.5rem auto 1rem !important;
    border-width: 3px !important;
    transform: scale(0.88);
}

.swal2-icon.swal2-error {
    border-color: #fca5a5 !important;
    color: #ef4444 !important;
}

.swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
    background-color: #ef4444 !important;
}

.swal2-icon.swal2-success {
    border-color: #a7f3d0 !important;
    color: #10b981 !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: #10b981 !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(16, 185, 129, 0.25) !important;
}

.swal2-icon.swal2-warning {
    border-color: #fde68a !important;
    color: #f59e0b !important;
}

.swal2-actions {
    margin: 1.25rem auto 0 !important;
    gap: 10px !important;
}

.swal2-styled.swal2-confirm,
.swal2-auth-btn {
    border-radius: 10px !important;
    padding: 10px 24px !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    background: var(--ds-primary-gradient, linear-gradient(135deg, #1a7efb 0%, #1052c2 100%)) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(var(--ds-primary-rgb, 26, 126, 251), 0.35) !important;
    transition: transform 0.15s, box-shadow 0.15s !important;
    cursor: pointer !important;
    outline: none !important;
}

.swal2-styled.swal2-confirm:hover,
.swal2-auth-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(var(--ds-primary-rgb, 26, 126, 251), 0.45) !important;
}

.swal2-styled.swal2-cancel {
    border-radius: 10px !important;
    padding: 10px 20px !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    background: var(--ds-surface-subtle, #f1f5f9) !important;
    color: var(--ds-text-main, #334155) !important;
    border: 1px solid var(--ds-border, #cbd5e1) !important;
}

