/* ============================================================
   NEW SUPPORT — Auth Premium (Login + Registro)
   Visual distinto: aurora azul, glass card, split layout
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --ns-bg: #060a14;
    --ns-bg-2: #0c1222;
    --ns-surface: rgba(14, 20, 36, 0.88);
    --ns-card: rgba(255, 255, 255, 0.04);
    --ns-border: rgba(148, 163, 184, 0.14);
    --ns-blue: #3b82f6;
    --ns-blue-bright: #60a5fa;
    --ns-blue-deep: #1d4ed8;
    --ns-indigo: #6366f1;
    --ns-text: #f1f5f9;
    --ns-muted: #94a3b8;
    --ns-gold: #f59e0b;
    --ns-success: #22c55e;
    --ns-radius: 22px;
    --ns-radius-sm: 14px;
    --ns-shadow: 0 32px 64px -24px rgba(0, 0, 0, 0.65);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body.ft-premium-auth {
    margin: 0;
    min-height: 100%;
    min-height: 100dvh;
    overflow-x: hidden;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--ns-bg);
    color: var(--ns-text);
    -webkit-font-smoothing: antialiased;
}

.auth-flash-wrap {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    width: min(94vw, 440px);
    pointer-events: none;
}

.auth-flash-wrap .alert,
.auth-flash-wrap .message {
    pointer-events: auto;
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: var(--ns-shadow);
}

/* ─── Page shell ─── */
.ns-auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    width: 100%;
}

/* ─── Left showcase ─── */
.ns-auth-showcase {
    position: relative;
    padding: clamp(28px, 5vw, 56px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 60% at 10% 20%, rgba(59, 130, 246, 0.22), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 80%, rgba(99, 102, 241, 0.16), transparent 50%),
        linear-gradient(165deg, #070b16 0%, #0c1222 40%, #0a1020 100%);
    border-right: 1px solid var(--ns-border);
}

.ns-auth-showcase__mesh {
    position: absolute;
    inset: -20%;
    background:
        conic-gradient(from 200deg at 50% 50%, transparent, rgba(59, 130, 246, 0.08), transparent 40%),
        radial-gradient(circle at 30% 40%, rgba(96, 165, 250, 0.15), transparent 45%);
    animation: ns-mesh-spin 28s linear infinite;
    pointer-events: none;
}

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

.ns-auth-showcase__grid {
    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);
    background-size: 56px 56px;
    mask-image: linear-gradient(180deg, black 0%, transparent 92%);
    pointer-events: none;
}

.ns-auth-showcase__inner {
    position: relative;
    z-index: 1;
    max-width: 520px;
}

.ns-auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    margin-bottom: clamp(32px, 6vh, 56px);
}

.ns-auth-brand__icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.2), rgba(99, 102, 241, 0.12));
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.25);
}

.ns-auth-brand__icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
}

.ns-auth-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.ns-auth-brand__new {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ns-blue-bright);
}

.ns-auth-brand__support {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ns-muted);
}

.ns-auth-hero__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ns-blue-bright);
    margin: 0 0 12px;
}

.ns-auth-hero__title {
    font-size: clamp(2rem, 4.5vw, 3.15rem);
    font-weight: 800;
    line-height: 1.08;
    margin: 0 0 16px;
    letter-spacing: -0.03em;
}

.ns-auth-hero__accent {
    background: linear-gradient(120deg, var(--ns-blue-bright), var(--ns-indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ns-auth-hero__desc {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ns-muted);
    margin: 0 0 28px;
    max-width: 42ch;
}

.ns-auth-metrics {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ns-auth-metrics li {
    flex: 1;
    min-width: 100px;
    padding: 14px 16px;
    background: var(--ns-card);
    border: 1px solid var(--ns-border);
    border-radius: var(--ns-radius-sm);
    backdrop-filter: blur(12px);
}

.ns-auth-metrics strong {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ns-text);
}

.ns-auth-metrics span {
    font-size: 0.72rem;
    color: var(--ns-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ns-auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ns-auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.ns-auth-features i {
    font-size: 1.25rem;
    color: var(--ns-blue);
    width: 28px;
    text-align: center;
}

/* ─── Right panel ─── */
.ns-auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 4vw, 48px);
    background:
        radial-gradient(circle at 80% 10%, rgba(59, 130, 246, 0.06), transparent 40%),
        var(--ns-bg-2);
}

.ns-auth-card {
    width: 100%;
    max-width: 420px;
    padding: clamp(28px, 4vw, 40px);
    background: var(--ns-surface);
    border: 1px solid var(--ns-border);
    border-radius: var(--ns-radius);
    box-shadow: var(--ns-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.ns-auth-panel--register .ns-auth-card {
    max-width: 460px;
}

.ns-auth-card__head {
    margin-bottom: 28px;
}

.ns-auth-card__head h2 {
    font-size: 1.65rem;
    font-weight: 800;
    margin: 12px 0 6px;
    letter-spacing: -0.02em;
}

.ns-auth-card__head p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--ns-muted);
}

.ns-auth-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--ns-success);
}

.ns-auth-pill--gold {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: var(--ns-gold);
}

.ns-auth-pill__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: ns-pulse 2s ease-in-out infinite;
}

@keyframes ns-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* ─── Form ─── */
.ns-auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ns-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.ns-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #cbd5e1;
}

.ns-field label i {
    color: var(--ns-blue);
    font-size: 1rem;
}

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

.ns-input,
body.ft-premium-auth .ns-input,
body.ft-premium-auth input.ns-input {
    width: 100% !important;
    padding: 13px 16px !important;
    font-size: 0.95rem !important;
    font-family: inherit !important;
    color: var(--ns-text) !important;
    background: rgba(0, 0, 0, 0.25) !important;
    border: 1px solid var(--ns-border) !important;
    border-radius: 12px !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ns-input::placeholder {
    color: #64748b;
}

.ns-input:focus,
body.ft-premium-auth .ns-input:focus {
    outline: none !important;
    border-color: var(--ns-blue) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

.ns-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
}

.ns-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--ns-muted);
}

.ns-check--terms {
    margin-top: 4px;
}

.ns-check__input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--ns-blue);
    flex-shrink: 0;
}

.ns-link {
    color: var(--ns-blue-bright);
    font-weight: 600;
    text-decoration: none;
}

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

.ns-link--inline {
    margin-left: auto;
}

.ns-btn,
body.ft-premium-auth .ns-btn,
body.ft-premium-auth input.ns-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px !important;
    border: none !important;
    border-radius: 12px !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ns-btn--primary,
body.ft-premium-auth .ns-btn--primary,
body.ft-premium-auth input.ns-btn--primary {
    color: #fff !important;
    background: linear-gradient(135deg, var(--ns-blue-deep), var(--ns-blue)) !important;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.4);
}

.ns-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.45);
}

.ns-btn--primary:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.ns-auth-switch {
    text-align: center;
    margin: 22px 0 0;
    font-size: 0.9rem;
    color: var(--ns-muted);
}

.ns-auth-switch a {
    color: var(--ns-blue-bright);
    font-weight: 700;
    text-decoration: none;
}

.ns-auth-copy {
    text-align: center;
    margin: 16px 0 0;
    font-size: 0.72rem;
    color: #64748b;
}

/* CakePHP wrappers */
.ns-auth-form .input,
.ns-auth-form div.input {
    margin: 0;
}

.ns-auth-form .error-message {
    font-size: 0.75rem;
    color: #f87171;
    margin-top: 4px;
}

/* 2FA legacy */
.ft-wrapper.ft-wrapper-center {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

/* ─── Responsive ─── */
@media (max-width: 991px) {
    .ns-auth-page {
        grid-template-columns: 1fr;
    }

    .ns-auth-showcase {
        border-right: none;
        border-bottom: 1px solid var(--ns-border);
        padding: 24px 22px 20px;
    }

    .ns-auth-brand {
        margin-bottom: 20px;
    }

    .ns-auth-hero__title {
        font-size: 1.75rem;
    }

    .ns-auth-metrics,
    .ns-auth-features {
        display: none;
    }

    .ns-auth-hero__desc {
        margin-bottom: 0;
        font-size: 0.9rem;
    }

    .ns-auth-panel {
        padding: 22px 18px 32px;
    }
}

@media (max-width: 520px) {
    .ns-field-grid {
        grid-template-columns: 1fr;
    }

    .ns-auth-card {
        padding: 22px 18px;
        border-radius: 18px;
    }

    .ns-input {
        font-size: 16px !important;
    }
}

@media (max-height: 700px) and (min-width: 992px) {
    .ns-auth-showcase {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .ns-auth-brand {
        margin-bottom: 24px;
    }

    .ns-auth-metrics {
        margin-bottom: 16px;
    }

    .ns-auth-features {
        gap: 6px;
    }
}
