/* =========================================================
   Electrosofting — Pantallas de autenticación
   ========================================================= */

:root {
    --auth-primary: #1d4ed8;
    --auth-primary-dark: #1e40af;
    --auth-accent: #fbbf24;
    --auth-bg: #f8fafc;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #e5e7eb;
}

* { box-sizing: border-box; }
body.auth-body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--auth-text);
    background: var(--auth-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ----------- Shell (2 columnas) ----------- */
.auth-shell {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

/* ----------- Panel marca (ejecutivo / slate-900) ----------- */
.auth-brand-panel {
    position: relative;
    background:
        linear-gradient(135deg, #0b1220 0%, #111827 35%, #0f172a 100%);
    color: #f8fafc;
    padding: 56px 56px 48px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
/* Grid sutil de líneas + dots para textura ejecutiva */
.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 48px 48px, 48px 48px, 24px 24px;
    background-position: 0 0, 0 0, 0 0;
    pointer-events: none;
}
/* Línea acento dorada arriba */
.auth-brand-panel::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #fbbf24 0%, #f97316 40%, #db2777 80%, #7c3aed 100%);
    z-index: 2;
}

.brand-deco {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(60px);
}
.brand-deco-1 {
    width: 360px; height: 360px;
    top: -120px; right: -140px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.18) 0%, transparent 70%);
}
.brand-deco-2 {
    width: 380px; height: 380px;
    bottom: -160px; left: -140px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.24) 0%, transparent 70%);
}
.brand-deco-3 {
    width: 260px; height: 260px;
    top: 38%; right: 14%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.16) 0%, transparent 70%);
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.auth-brand-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 48px;
}
.brand-mark {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #0f172a;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.3),
                inset 0 -2px 4px rgba(0,0,0,0.15);
}
.brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: #ffffff;
}
.brand-tagline {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.auth-brand-tagline {
    margin: auto 0;
}
.auth-brand-tagline h2 {
    font-size: clamp(1.8rem, 2.5vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.15;
    margin: 0 0 14px;
    color: #ffffff;
}
.auth-brand-tagline .accent {
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 50%, #fb7185 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-brand-tagline p {
    font-size: 0.98rem;
    color: rgba(255,255,255,0.7);
    margin: 0;
    max-width: 480px;
    line-height: 1.55;
}

.auth-brand-list {
    list-style: none;
    padding: 0;
    margin: 32px 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.auth-brand-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px;
    transition: all 200ms;
}
.auth-brand-list li:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(251,191,36,0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}
.auth-brand-list .ic {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.auth-brand-list strong {
    display: block;
    font-weight: 600;
    font-size: 0.86rem;
    line-height: 1.2;
    color: #ffffff;
}
.auth-brand-list small {
    display: block;
    color: rgba(255,255,255,0.6);
    font-size: 0.74rem;
    margin-top: 2px;
    line-height: 1.35;
}

/* Colores variados para iconos de features — paleta brillante para fondo oscuro */
.feat-ic-blue   { background: rgba(59,130,246,0.18);  color: #60a5fa; box-shadow: 0 0 12px rgba(59,130,246,0.15); }
.feat-ic-green  { background: rgba(34,197,94,0.18);   color: #4ade80; box-shadow: 0 0 12px rgba(34,197,94,0.15); }
.feat-ic-amber  { background: rgba(251,191,36,0.18);  color: #fbbf24; box-shadow: 0 0 12px rgba(251,191,36,0.15); }
.feat-ic-rose   { background: rgba(244,114,182,0.18); color: #fb7185; box-shadow: 0 0 12px rgba(244,114,182,0.15); }
.feat-ic-violet { background: rgba(168,85,247,0.18);  color: #c084fc; box-shadow: 0 0 12px rgba(168,85,247,0.15); }
.feat-ic-cyan   { background: rgba(34,211,238,0.18);  color: #22d3ee; box-shadow: 0 0 12px rgba(34,211,238,0.15); }
.feat-ic-indigo { background: rgba(99,102,241,0.18);  color: #818cf8; box-shadow: 0 0 12px rgba(99,102,241,0.15); }
.feat-ic-teal   { background: rgba(20,184,166,0.18);  color: #2dd4bf; box-shadow: 0 0 12px rgba(20,184,166,0.15); }

.auth-brand-footer {
    margin-top: 36px;
    color: rgba(255,255,255,0.55);
    font-size: 0.76rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}
.auth-brand-footer .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18),
                0 0 12px rgba(74, 222, 128, 0.5);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* ----------- Panel form ----------- */
.auth-form-panel {
    background: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.auth-back-link {
    position: absolute;
    top: 28px; right: 32px;
    color: var(--auth-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 150ms;
}
.auth-back-link:hover {
    background: var(--auth-bg);
    color: var(--auth-primary);
}

.auth-form-wrap {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

.auth-mobile-brand {
    display: none;
    text-align: center;
    margin-bottom: 24px;
}
.auth-mobile-brand .brand-mark {
    background: linear-gradient(135deg, var(--auth-primary), #6d28d9);
    color: #fff;
    margin: 0 auto 10px;
    border: 0;
}
.auth-mobile-brand h1 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.auth-form-header {
    margin-bottom: 24px;
}
.auth-form-header .form-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    color: var(--auth-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 14px;
}
.auth-form-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 4px;
    letter-spacing: -0.4px;
}
.auth-form-header p {
    color: var(--auth-muted);
    margin: 0;
    font-size: 0.92rem;
}

/* ----------- Form fields ----------- */
.auth-field {
    margin-bottom: 16px;
}
.auth-field .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.auth-field .form-label i { color: var(--auth-primary); font-size: 0.9rem; }
.auth-input-wrap {
    position: relative;
}
.auth-input-wrap .form-control {
    padding: 12px 14px 12px 42px;
    height: auto;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 150ms;
    background: #fff;
}
.auth-input-wrap .form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
}
.auth-input-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-muted);
    pointer-events: none;
    font-size: 1rem;
}
.auth-input-wrap .input-action {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: var(--auth-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.auth-input-wrap .input-action:hover { background: var(--auth-bg); color: var(--auth-primary); }
.auth-input-wrap .form-control:has(+ .input-action),
.auth-input-wrap .form-control + .input-action ~ .form-control { padding-right: 44px; }

.auth-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0 18px;
    font-size: 0.85rem;
}
.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--auth-muted);
}
.auth-remember input { margin: 0; }
.auth-forgot {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
}
.auth-forgot:hover { text-decoration: underline; }

/* ----------- Submit ----------- */
.auth-btn-submit {
    width: 100%;
    padding: 12px 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--auth-primary), #4338ca);
    color: #fff;
    border: 0;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 150ms;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
}
.auth-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.35);
}
.auth-btn-submit:active { transform: translateY(0); }

/* ----------- Divider y footer ----------- */
.auth-divider {
    margin: 22px 0 14px;
    text-align: center;
    color: var(--auth-muted);
    font-size: 0.78rem;
    position: relative;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: var(--auth-border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-help-links {
    text-align: center;
    font-size: 0.85rem;
    color: var(--auth-muted);
}
.auth-help-links a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
}
.auth-help-links a:hover { text-decoration: underline; }

.auth-meta {
    margin-top: 24px;
    text-align: center;
    color: var(--auth-muted);
    font-size: 0.72rem;
}
.auth-meta i { color: #16a34a; }

/* ----------- Alerts ----------- */
.auth-body .alert {
    border-radius: 10px;
    border-width: 0;
    border-left: 3px solid;
    padding: 12px 14px;
    font-size: 0.88rem;
    margin-bottom: 18px;
}
.auth-body .alert-danger { background: #fef2f2; border-left-color: #dc2626; color: #991b1b; }
.auth-body .alert-success { background: #f0fdf4; border-left-color: #16a34a; color: #166534; }
.auth-body .alert i { font-size: 1.05rem; }

/* ----------- Responsive ----------- */
@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand-panel { display: none; }
    .auth-form-panel { padding: 32px 24px; }
    .auth-mobile-brand { display: block; }
    .auth-back-link { top: 16px; right: 16px; }
    .auth-back-link span { display: none; }
}

@media (max-width: 575.98px) {
    .auth-form-wrap { max-width: 100%; }
}

/* ----------- Animaciones ----------- */
.auth-form-wrap { animation: authIn 400ms cubic-bezier(0.4, 0, 0.2, 1) both; }
@keyframes authIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
