/* ============================================================
   NEXUS · Auth Design System
   ============================================================ */

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

/* -------- TOKENS -------- */
:root {
    /* Verdes */
    --green-900: #022c25;
    --green-800: #043d34;
    --green-700: #05695a;
    --green-600: #0a8070;
    --green-500: #10a08c;
    --green-100: #d9f0e9;
    --green-50:  #eef8f5;

    /* Tinta */
    --ink-900: #0d1a1f;
    --ink-700: #2a3a42;
    --ink-500: #5a6b73;
    --ink-400: #8a99a1;

    /* Neutros */
    --line: #e3ebe8;
    --bg: #f5f7f6;
    --surface: #ffffff;

    /* Feedback */
    --danger-700: #b91c1c;
    --danger-100: #fef2f2;
    --danger-200: #fecaca;
    --warn-700: #92400e;
    --warn-100: #fffbeb;
    --warn-200: #fde68a;

    /* Layout */
    --shell-radius: 28px;
    --shell-max: 1180px;
    --shell-min-h: 700px;
    --panel-radius: 22px;
    --field-radius: 14px;
    --btn-radius: 14px;

    /* Motion */
    --ease: cubic-bezier(.2,.7,.3,1);
    --dur: .18s;
}

/* -------- SELEÇÃO -------- */
::selection {
    background: var(--green-500);
    color: #fff;
}

/* -------- BASE -------- */
html, body {
    min-height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background: var(--bg);
    color: var(--ink-900);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* -------- SHELL -------- */
.auth-shell {
    width: min(var(--shell-max), 100%);
    min-height: var(--shell-min-h);
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--surface);
    border-radius: var(--shell-radius);
    overflow: hidden;
    box-shadow:
        0 1px 2px rgba(13,26,31,.04),
        0 30px 70px -25px rgba(4,61,52,.28);
}

/* ============================================================
   BRAND PANEL
   ============================================================ */
.auth-brand {
    position: relative;
    overflow: hidden;
    padding: 56px 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(160deg, var(--green-700) 0%, var(--green-900) 100%);
    color: #fff;
    isolation: isolate;
}

/* Grid sutil — decorativo */
.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
    background-size: 140px 140px;
    mask-image: radial-gradient(ellipse 60% 50% at 25% 25%, #000 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 25% 25%, #000 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* Halo verde */
.auth-brand::after {
    content: "";
    position: absolute;
    width: 640px;
    height: 640px;
    right: -240px;
    bottom: -240px;
    background: radial-gradient(circle, rgba(16,160,140,.28) 0%, transparent 60%);
    z-index: -1;
    filter: blur(20px);
    pointer-events: none;
}

/* ============================================================
   LOGO + NOME (cabeçalho da marca)
   ============================================================ */
.auth-brand__top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
}

.auth-brand__logo {
    display: block;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    line-height: 0;
}

.auth-brand__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1);
}

.auth-brand__logo::before { content: none; }

.auth-brand__name {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .32em;
    color: #fff;
    line-height: 1;
    padding-left: .32em; /* compensa letter-spacing visual */
}

/* ============================================================
   HERO — headline + descrição
   ============================================================ */
.auth-brand__hero {
    position: relative;
    z-index: 1;
    margin: 40px 0 0;
}

.auth-brand__tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(255,255,255,.65);
    margin-bottom: 22px;
}
.auth-brand__tag::before {
    content: "";
    width: 24px;
    height: 1px;
    background: rgba(255,255,255,.4);
}

.auth-brand__headline {
    font-size: clamp(2rem, 3.4vw, 2.9rem);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    max-width: 15ch;
}
.auth-brand__headline em {
    font-style: normal;
    color: var(--green-500);
    position: relative;
    display: inline-block;
}
.auth-brand__headline em::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 2px;
    height: 8px;
    background: rgba(16,160,140,.2);
    border-radius: 4px;
    z-index: -1;
}

.auth-brand__desc {
    margin-top: 24px;
    font-size: .95rem;
    line-height: 1.65;
    color: rgba(255,255,255,.62);
    max-width: 42ch;
}

/* ============================================================
   FOOTER — stats
   ============================================================ */
.auth-brand__footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 32px;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: .75rem;
    color: rgba(255,255,255,.42);
}

.auth-brand__stats { display: flex; gap: 28px; }
.auth-brand__stat b {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.01em;
}
.auth-brand__stat span {
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* ============================================================
   AUTH PANEL
   ============================================================ */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px;
    background: var(--surface);
}

.auth-panel__inner {
    width: 100%;
    max-width: 400px;
}

/* -------- Eyebrow -------- */
.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--green-700);
    margin-bottom: 16px;
}
.auth-eyebrow__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green-500);
    box-shadow: 0 0 0 4px rgba(16,160,140,.14);
}

/* -------- Títulos -------- */
.auth-title {
    font-size: 2.1rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.025em;
    color: var(--ink-900);
    margin-bottom: 10px;
}

.auth-lead {
    font-size: .95rem;
    color: var(--ink-500);
    margin-bottom: 36px;
}

/* -------- Alert -------- */
.auth-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: var(--danger-100);
    border: 1px solid var(--danger-200);
    color: var(--danger-700);
    font-size: .84rem;
    line-height: 1.5;
}
.auth-alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}
.auth-alert ul { margin: 6px 0 0 18px; }

/* -------- Fields -------- */
.auth-field {
    position: relative;
    margin-bottom: 18px;
}

.auth-field > label {
    display: block;
    margin-bottom: 8px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-500);
}

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

.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--green-50);
    color: var(--green-700);
    pointer-events: none;
}
.auth-input-icon svg { width: 17px; height: 17px; }

.auth-field input {
    width: 100%;
    height: 58px;
    padding: 0 16px 0 60px;
    border: 1.5px solid var(--line);
    border-radius: var(--field-radius);
    background: var(--surface);
    color: var(--ink-900);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--dur) var(--ease),
                box-shadow var(--dur) var(--ease),
                background var(--dur) var(--ease);
}
.auth-field input::placeholder { color: var(--ink-400); }
.auth-field input:hover { border-color: #cfdbd7; }
.auth-field input:focus {
    border-color: var(--green-600);
    box-shadow: 0 0 0 4px rgba(10,128,112,.10);
}

/* Variação: input com botão de senha */
.auth-field--pass input { padding-right: 52px; }

.auth-toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: none;
    background: transparent;
    border-radius: 10px;
    color: var(--ink-400);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.auth-toggle-pass:hover {
    color: var(--green-700);
    background: var(--green-50);
}
.auth-toggle-pass svg { width: 18px; height: 18px; }

/* Erro inline */
.auth-field__error {
    color: var(--danger-700);
    font-size: .78rem;
    margin-top: 6px;
}

/* Texto de ajuda */
.auth-help {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--green-50);
    border-radius: 10px;
    font-size: .76rem;
    color: var(--ink-700);
    line-height: 1.5;
}
.auth-help ul { margin: 0; padding-left: 18px; }

/* -------- Options (remember + forgot) -------- */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 28px;
    flex-wrap: wrap;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: .88rem;
    color: var(--ink-700);
    cursor: pointer;
    user-select: none;
}
.auth-check input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid #c8d4d0;
    border-radius: 5px;
    background: var(--surface);
    cursor: pointer;
    position: relative;
    transition: all .15s var(--ease);
    flex-shrink: 0;
}
.auth-check input:checked {
    background: var(--green-700);
    border-color: var(--green-700);
}
.auth-check input:checked::after {
    content: "";
    position: absolute;
    left: 5px; top: 1px;
    width: 5px; height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.auth-check input:focus-visible {
    box-shadow: 0 0 0 3px rgba(10,128,112,.2);
}

.auth-link {
    font-size: .88rem;
    font-weight: 600;
    color: var(--green-700);
    text-decoration: none;
    transition: color var(--dur) var(--ease);
}
.auth-link:hover {
    color: var(--green-800);
    text-decoration: underline;
}

/* -------- Button -------- */
.auth-btn {
    width: 100%;
    height: 58px;
    border: none;
    border-radius: var(--btn-radius);
    background: var(--green-700);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background var(--dur) var(--ease),
                transform .15s var(--ease),
                box-shadow var(--dur) var(--ease);
    text-decoration: none;
}

.auth-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.14) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform .6s ease;
}
.auth-btn:hover:not(:disabled) {
    background: var(--green-800);
    box-shadow: 0 12px 28px -10px rgba(4,61,52,.5);
}
.auth-btn:hover:not(:disabled)::before { transform: translateX(100%); }
.auth-btn:active:not(:disabled) { transform: translateY(1px); }
.auth-btn:disabled { opacity: .7; cursor: not-allowed; }
.auth-btn svg { width: 18px; height: 18px; }

/* Variação: botão fantasma */
.auth-btn--ghost {
    background: var(--surface);
    color: var(--green-700);
    border: 1.5px solid var(--line);
    box-shadow: none;
}
.auth-btn--ghost:hover:not(:disabled) {
    background: var(--green-50);
    border-color: var(--green-100);
    color: var(--green-800);
    box-shadow: none;
}
.auth-btn--ghost::before { display: none; }

/* -------- Spinner -------- */
.auth-spinner { animation: auth-spin .8s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* -------- Actions (empilhamento de botões) -------- */
.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* -------- Badge de sucesso -------- */
.auth-success-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--green-50);
    border: 1.5px solid var(--green-100);
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
    color: var(--green-700);
}
.auth-success-badge svg { width: 32px; height: 32px; }

/* -------- Caixa de aviso -------- */
.auth-tip {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: var(--warn-100);
    border: 1px solid var(--warn-200);
    color: var(--warn-700);
    font-size: .82rem;
    line-height: 1.55;
}
.auth-tip svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

/* -------- Passos numerados -------- */
.auth-steps {
    background: var(--green-50);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 24px;
}
.auth-steps h3 {
    font-size: .82rem;
    font-weight: 700;
    color: var(--green-800);
    margin-bottom: 12px;
    letter-spacing: .02em;
}
.auth-steps ol {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.auth-steps li {
    display: flex;
    gap: 10px;
    font-size: .83rem;
    color: var(--ink-700);
    line-height: 1.5;
}
.auth-steps .num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--green-100);
    color: var(--green-700);
    font-size: .72rem;
    font-weight: 700;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

/* -------- Estado inválido (link expirado) -------- */
.auth-invalid {
    text-align: center;
    padding: 8px 0;
}
.auth-invalid__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--danger-100);
    border: 1.5px solid var(--danger-200);
    color: var(--danger-700);
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
}
.auth-invalid__icon svg { width: 28px; height: 28px; }
.auth-invalid h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink-900);
    margin-bottom: 8px;
}
.auth-invalid p {
    font-size: .9rem;
    color: var(--ink-500);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* -------- Panel footer -------- */
.auth-foot {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: .78rem;
    color: var(--ink-400);
    flex-wrap: wrap;
}

.auth-foot--center {
    justify-content: center;
    text-align: center;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--green-700);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--dur) var(--ease);
}
.auth-back:hover { color: var(--green-800); text-decoration: underline; }
.auth-back svg { width: 14px; height: 14px; }

.auth-secure {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-500);
}
.auth-secure svg { width: 13px; height: 13px; }

/* ============================================================
   RESPONSIVO
   ============================================================ */

/* -------- TABLET -------- */
@media (max-width: 1024px) {
    body { padding: 20px; }

    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 560px;
        min-height: 0;
        border-radius: 26px;
        background: transparent;
        overflow: visible;
        box-shadow: none;
        position: relative;
    }

    .auth-brand {
        min-height: 260px;
        padding: 40px 36px 96px;
        border-radius: 26px 26px 0 0;
    }
    .auth-brand__hero { margin: 24px 0 0; }
    .auth-brand__headline { font-size: 1.85rem; max-width: none; }
    .auth-brand__desc,
    .auth-brand__footer { display: none; }

    .auth-panel {
        background: transparent;
        padding: 0;
        margin-top: -70px;
        position: relative;
        z-index: 2;
    }
    .auth-panel__inner {
        max-width: none;
        background: var(--surface);
        border-radius: var(--panel-radius);
        padding: 32px 28px 26px;
        box-shadow: 0 20px 50px -20px rgba(4,61,52,.35);
    }
}

/* -------- MOBILE -------- */
@media (max-width: 640px) {
    body {
        padding: 0;
        align-items: stretch;
        background: var(--green-900);
    }

    .auth-shell {
        max-width: none;
        border-radius: 0;
        min-height: 100dvh;
        display: block;
        background: var(--bg);
    }

    .auth-brand {
        min-height: 340px;
        padding: 48px 24px 130px;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        text-align: center;
    }
    .auth-brand__top {
        flex-direction: column;
        gap: 16px;
        justify-content: center;
    }

    /* Logo grande e centralizada no mobile */
    .auth-brand__logo {
        width: 96px;
        height: 96px;
    }

    .auth-brand__name {
        font-size: 1.5rem;
        letter-spacing: .34em;
        padding-left: .34em;
    }

    .auth-brand__hero {
        margin: 22px 0 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .auth-brand__tag {
        font-size: .72rem;
        letter-spacing: .24em;
        margin-bottom: 0;
        color: rgba(255,255,255,.75);
    }
    .auth-brand__tag::before { display: none; }
    .auth-brand__headline,
    .auth-brand__desc,
    .auth-brand__footer { display: none; }

    .auth-panel {
        background: transparent;
        padding: 0 16px 32px;
        margin-top: -100px;
        position: relative;
        z-index: 2;
        display: block;
    }
    .auth-panel__inner {
        background: var(--surface);
        border-radius: var(--panel-radius);
        padding: 28px 22px 24px;
        box-shadow:
            0 1px 2px rgba(13,26,31,.04),
            0 24px 48px -18px rgba(4,61,52,.35);
        max-width: none;
    }

    .auth-eyebrow { display: none; }
    .auth-title { font-size: 1.55rem; margin-bottom: 6px; }
    .auth-lead { font-size: .9rem; margin-bottom: 24px; }
    .auth-field input { height: 56px; border-radius: var(--field-radius); }
    .auth-btn { height: 56px; border-radius: var(--btn-radius); }
    .auth-foot { margin-top: 22px; padding-top: 18px; font-size: .74rem; }
}

/* -------- TELAS MUITO PEQUENAS -------- */
@media (max-width: 360px) {
    .auth-brand { padding: 38px 20px 120px; min-height: 320px; }
    .auth-brand__logo { width: 84px; height: 84px; }
    .auth-brand__name { font-size: 1.3rem; }
    .auth-panel__inner { padding: 22px 18px 20px; }
}