/* ============================================================================
   Telas de autenticação — identidade visual TraceTag
   Superfície dark + gradiente de marca azul→ciano (pin + circuito do ícone).
   Layout split-screen: hero "rede viva" à esquerda, formulário à direita.
   ========================================================================= */

:root {
    --tt-bg: #0a0e15;
    --tt-bg-2: #0c1119;
    --tt-panel: #121826;
    --tt-glass: rgba(17, 23, 37, 0.72);
    --tt-border: rgba(255, 255, 255, 0.08);
    --tt-border-strong: rgba(255, 255, 255, 0.14);

    --tt-ink: #e9eef6;
    --tt-muted: #8b97a8;
    --tt-faint: #5d6a7d;

    --tt-blue: #3b7bf6;
    --tt-cyan: #17c8e8;
    --tt-accent: #22bfe6;
    --tt-grad: linear-gradient(135deg, #3b7bf6 0%, #17c8e8 100%);
    --tt-grad-btn: linear-gradient(120deg, #2f6bf0 0%, #3b7bf6 45%, #16c8e8 130%);

    --tt-danger: #ef4444;
    --tt-danger-soft: #fca5a5;

    --tt-font-display: 'Space Grotesk', sans-serif;
    --tt-font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html, body { height: 100%; }

body {
    font-family: var(--tt-font-body);
    color: var(--tt-ink);
    background: var(--tt-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ---- Estrutura ---------------------------------------------------------- */

.auth-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
}

.auth-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background:
        radial-gradient(120% 80% at 12% -10%, rgba(59, 123, 246, 0.14) 0%, transparent 46%),
        radial-gradient(120% 90% at 100% 110%, rgba(23, 200, 232, 0.10) 0%, transparent 50%);
    background-attachment: fixed;
}

/* ============================ HERO (rede viva) =========================== */

.auth-hero {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    padding: 48px 52px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(90% 60% at 20% 15%, rgba(59, 123, 246, 0.20) 0%, transparent 55%),
        radial-gradient(80% 60% at 85% 90%, rgba(23, 200, 232, 0.16) 0%, transparent 55%),
        linear-gradient(160deg, #0c1220 0%, #090d15 60%, #0a0e17 100%);
    border-right: 1px solid var(--tt-border);
}

/* grade sutil */
.auth-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(120% 100% at 30% 30%, #000 0%, transparent 78%);
    -webkit-mask-image: radial-gradient(120% 100% at 30% 30%, #000 0%, transparent 78%);
    pointer-events: none;
}

/* SVG da rede + trace animado.
   Seletor com especificidade > `.auth-hero > *` para manter o position/z-index. */
.auth-hero > .tt-net {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.tt-trace {
    stroke-dasharray: 90 1200;
    stroke-dashoffset: 1290;
    filter: drop-shadow(0 0 6px rgba(23, 200, 232, 0.65));
    animation: tt-trace 4.8s linear infinite;
}

.tt-trace.tt-trace-2 { animation-duration: 6.2s; animation-delay: 1.4s; }
.tt-trace.tt-trace-3 { animation-duration: 5.4s; animation-delay: 2.6s; }

.tt-nodes circle { animation: tt-pulse 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.tt-nodes circle:nth-child(2) { animation-delay: .5s; }
.tt-nodes circle:nth-child(3) { animation-delay: 1s; }
.tt-nodes circle:nth-child(4) { animation-delay: 1.6s; }
.tt-nodes circle:nth-child(5) { animation-delay: 2.1s; }

.auth-hero > * { position: relative; z-index: 1; }

/* topo: wordmark */
.hero-wordmark { height: 30px; width: auto; align-self: flex-start; opacity: .96; }

/* centro: pin de marca com radar */
.hero-stage {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
    margin: 8px 0;
}

.hero-mark {
    position: relative;
    width: 104px;
    height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* O símbolo da marca, recortado da logo. A arte é branca chapada: quem pinta o
   degradê é o background abaixo, com a máscara recortando a silhueta. */
.hero-tag {
    width: 84px;
    height: 84px;
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, #3b7bf6, #17c8e8);
    -webkit-mask: url("../imagens/simbolo-tracetag-white.png") no-repeat center / contain;
    mask: url("../imagens/simbolo-tracetag-white.png") no-repeat center / contain;
    filter: drop-shadow(0 12px 26px rgba(23, 120, 232, 0.45));
    animation: tt-float 6s ease-in-out infinite;
}

.hero-ping {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 92px;
    height: 92px;
    margin: -46px 0 0 -46px;
    border-radius: 50%;
    border: 1.5px solid rgba(34, 191, 230, 0.55);
    opacity: 0;
    animation: tt-ping 3.2s ease-out infinite;
}

.hero-ping.p2 { animation-delay: 1.05s; }
.hero-ping.p3 { animation-delay: 2.1s; }

.hero-copy { max-width: 24ch; }

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--tt-accent);
    margin-bottom: 16px;
}

.hero-eyebrow::before {
    content: "";
    width: 22px;
    height: 1.5px;
    background: linear-gradient(90deg, var(--tt-accent), transparent);
}

.hero-title {
    font-family: var(--tt-font-display);
    font-size: clamp(26px, 2.4vw, 34px);
    font-weight: 600;
    line-height: 1.16;
    letter-spacing: -.01em;
    color: #fff;
}

.hero-title .grad {
    background: var(--tt-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-sub {
    margin-top: 14px;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--tt-muted);
    max-width: 34ch;
}

/* rodapé do hero: recursos + status */
.hero-features {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-bottom: 22px;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    color: #cdd6e3;
}

.hero-feature .ic {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tt-cyan);
    background: rgba(34, 191, 230, 0.10);
    border: 1px solid rgba(34, 191, 230, 0.18);
    flex-shrink: 0;
}

.hero-feature .ic svg { width: 16px; height: 16px; }

.hero-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--tt-faint);
}

.hero-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: tt-live 1.9s ease-out infinite;
}

/* ============================ FORMULÁRIO ================================= */

.auth-form-side {
    min-height: 100vh;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    background:
        radial-gradient(100% 60% at 100% 0%, rgba(23, 200, 232, 0.06) 0%, transparent 55%),
        var(--tt-bg);
}

.auth-card {
    width: 100%;
    max-width: 396px;
}

/* marca compacta (aparece no mobile) */
.auth-brand-mobile {
    display: none;
    align-items: center;
    gap: 11px;
    margin-bottom: 26px;
}

.auth-brand-mobile img { height: 26px; width: auto; }

.auth-heading {
    font-family: var(--tt-font-display);
    font-size: 25px;
    font-weight: 600;
    letter-spacing: -.01em;
    margin-bottom: 7px;
}

.auth-subheading {
    font-size: 14px;
    color: var(--tt-muted);
    margin-bottom: 28px;
}

.auth-field { margin-bottom: 17px; }

.auth-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #c4cdda;
    margin-bottom: 8px;
}

.auth-input-wrap { position: relative; }

.auth-input {
    width: 100%;
    height: 48px;
    padding: 0 15px;
    background: #0e1420;
    border: 1px solid var(--tt-border);
    border-radius: 12px;
    color: var(--tt-ink);
    font-size: 14.5px;
    font-family: inherit;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.auth-input::placeholder { color: #566373; }

.auth-input:hover { border-color: var(--tt-border-strong); }

.auth-input:focus {
    outline: none;
    border-color: var(--tt-accent);
    background: #101828;
    box-shadow: 0 0 0 4px rgba(34, 191, 230, 0.16);
}

.auth-input.has-toggle { padding-right: 48px; }

.auth-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--tt-faint);
    cursor: pointer;
    border-radius: 9px;
    transition: color .15s ease, background .15s ease;
}

.auth-toggle:hover { color: var(--tt-ink); background: rgba(255, 255, 255, 0.05); }
.auth-toggle .material-symbols-outlined { font-size: 20px; }

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

.auth-check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--tt-muted);
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--tt-accent);
    cursor: pointer;
}

.auth-link {
    font-size: 13.5px;
    color: var(--tt-accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-link:hover { color: #4bd6f2; text-decoration: underline; }

.auth-submit {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 12px;
    background: var(--tt-grad-btn);
    color: #fff;
    font-family: var(--tt-font-display);
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-shadow: 0 10px 26px -10px rgba(47, 107, 240, 0.7);
    transition: filter .16s ease, box-shadow .16s ease, transform .06s ease;
}

.auth-submit:hover { filter: brightness(1.07); box-shadow: 0 14px 30px -10px rgba(47, 107, 240, 0.85); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit .material-symbols-outlined { font-size: 20px; }

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: var(--tt-danger-soft);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    margin-bottom: 22px;
    line-height: 1.4;
}

.auth-alert .material-symbols-outlined { font-size: 18px; margin-top: 1px; flex-shrink: 0; }
.auth-alert ul { margin: 0; padding: 0; list-style: none; }

.field-validation-error {
    display: block;
    margin-top: 7px;
    font-size: 12.5px;
    color: var(--tt-danger-soft);
}

.auth-input.input-validation-error { border-color: rgba(239, 68, 68, 0.55); }

.auth-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--tt-border);
    text-align: center;
    font-size: 12px;
    color: var(--tt-faint);
}

/* ---- Acesso negado ------------------------------------------------------ */

.auth-denied {
    width: 100%;
    max-width: 420px;
    background: var(--tt-glass);
    border: 1px solid var(--tt-border);
    border-radius: 20px;
    padding: 38px 34px 30px;
    text-align: center;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
}

.auth-denied-icon {
    width: 62px;
    height: 62px;
    border-radius: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.auth-denied-icon .material-symbols-outlined { font-size: 32px; }

/* ---- Animações ---------------------------------------------------------- */

@keyframes tt-trace { to { stroke-dashoffset: 0; } }
@keyframes tt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes tt-ping { 0% { transform: scale(.55); opacity: .8; } 100% { transform: scale(2.5); opacity: 0; } }
@keyframes tt-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes tt-live {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ---- Responsivo --------------------------------------------------------- */

@media (max-width: 900px) {
    .auth-split { grid-template-columns: minmax(0, 1fr); }
    .auth-hero { display: none; }
    .auth-form-side {
        min-height: 100vh;
        padding: 40px 22px;
        background:
            radial-gradient(120% 60% at 20% -10%, rgba(59, 123, 246, 0.16) 0%, transparent 48%),
            radial-gradient(120% 60% at 100% 110%, rgba(23, 200, 232, 0.12) 0%, transparent 50%),
            var(--tt-bg);
    }
    .auth-brand-mobile { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
    .tt-trace, .tt-nodes circle, .hero-tag, .hero-ping, .hero-live-dot { animation: none !important; }
    .tt-trace { stroke-dashoffset: 0; }
    .hero-ping { display: none; }
}
