/* Unio — tela de login (redesign) */

html:has(.auth-page) {
    height: 100%;
    overflow: hidden;
}

.auth-page {
    --auth-bg-deep: #060b14;
    --auth-bg-mid: #0c1524;
    --auth-accent: #3b82f6;
    --auth-accent-2: #14b8a6;
    --auth-glow: rgba(59, 130, 246, 0.22);
    --auth-card-bg: rgba(12, 18, 32, 0.82);
    --auth-card-border: rgba(255, 255, 255, 0.08);
    --auth-card-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --auth-text-soft: rgba(255, 255, 255, 0.62);
    --auth-chip-bg: rgba(255, 255, 255, 0.05);
    --auth-chip-border: rgba(255, 255, 255, 0.08);
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100dvh;
    height: 100dvh;
    font-family: 'Poppins', system-ui, sans-serif;
    color: #f1f5f9;
    background: var(--auth-bg-deep);
    overflow: hidden;
}

[data-theme="light"] .auth-page {
    --auth-bg-deep: #eef4f8;
    --auth-bg-mid: #f8fbfd;
    --auth-glow: rgba(59, 130, 246, 0.12);
    --auth-card-bg: rgba(255, 255, 255, 0.92);
    --auth-card-border: rgba(15, 23, 42, 0.08);
    --auth-card-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    --auth-text-soft: #64748b;
    --auth-chip-bg: rgba(255, 255, 255, 0.75);
    --auth-chip-border: rgba(59, 130, 246, 0.12);
    color: #0f172a;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
}

/* ── Cena de fundo ───────────────────────────────────── */
.auth-scene {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.auth-scene__gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 15% 20%, rgba(59, 130, 246, 0.18), transparent 55%),
        radial-gradient(ellipse 60% 50% at 85% 75%, rgba(20, 184, 166, 0.12), transparent 50%),
        linear-gradient(145deg, var(--auth-bg-deep) 0%, var(--auth-bg-mid) 48%, var(--auth-bg-deep) 100%);
}

[data-theme="light"] .auth-scene__gradient {
    background:
        radial-gradient(ellipse 70% 55% at 12% 18%, rgba(59, 130, 246, 0.14), transparent 55%),
        radial-gradient(ellipse 55% 45% at 88% 80%, rgba(20, 184, 166, 0.1), transparent 50%),
        linear-gradient(160deg, #e8f2f8 0%, #f5f9fc 45%, #eef4f8 100%);
}

.auth-scene__grid {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, black 20%, transparent 75%);
}

[data-theme="light"] .auth-scene__grid {
    opacity: 0.5;
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.06) 1px, transparent 1px);
}

.auth-scene__ecg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    opacity: 0.2;
    background: linear-gradient(180deg, transparent, rgba(59, 130, 246, 0.08));
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100'%3E%3Cpath d='M0 50 H80 L110 20 L140 70 L170 15 L200 50 L230 38 L260 62 L300 25 L360 50 L420 35 L480 65 L540 28 L600 50 L660 42 L720 58 L780 30 L840 50 L900 40 L960 55 L1020 32 L1080 50 L1200 44' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E");
    mask-size: 140% 100%;
    mask-repeat: no-repeat;
    mask-position: center bottom;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100'%3E%3Cpath d='M0 50 H80 L110 20 L140 70 L170 15 L200 50 L230 38 L260 62 L300 25 L360 50 L420 35 L480 65 L540 28 L600 50 L660 42 L720 58 L780 30 L840 50 L900 40 L960 55 L1020 32 L1080 50 L1200 44' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E");
    -webkit-mask-size: 140% 100%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center bottom;
}

.auth-scene__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: auth-orb-float 18s ease-in-out infinite;
}

.auth-scene__orb--1 {
    width: 320px;
    height: 320px;
    top: -80px;
    left: -60px;
    background: rgba(59, 130, 246, 0.2);
}

.auth-scene__orb--2 {
    width: 280px;
    height: 280px;
    bottom: 10%;
    right: 5%;
    background: rgba(20, 184, 166, 0.14);
    animation-delay: -6s;
}

@keyframes auth-orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(12px, -18px) scale(1.04); }
}

/* ── Layout principal ────────────────────────────────── */
.auth-main {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

.auth-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 28px;
    pointer-events: none;
}

.auth-topbar > *,
.auth-topbar__actions > * {
    pointer-events: auto;
}

.auth-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-topbar__register {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: var(--auth-text-soft);
    background: var(--auth-chip-bg);
    border: 1px solid var(--auth-chip-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.auth-topbar__register:hover {
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.1);
    text-decoration: none;
}

[data-theme="light"] .auth-topbar__register:hover {
    color: #2563eb;
    background: #fff;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: var(--auth-text-soft);
    background: var(--auth-chip-bg);
    border: 1px solid var(--auth-chip-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.auth-back:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

[data-theme="light"] .auth-back:hover {
    color: #0f172a;
    border-color: rgba(59, 130, 246, 0.25);
    background: #fff;
}

.auth-back i {
    font-size: 10px;
}

/* ── Painel de marca ─────────────────────────────────── */
.auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 76px 56px 20px 64px;
    min-height: 0;
    overflow: visible;
}

.auth-brand__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 520px;
}

.auth-brand__logo {
    display: block;
    margin: 0 0 36px;
    line-height: 0;
    overflow: visible;
}

.auth-brand__logo .auth-logo__img,
.auth-brand__logo img,
.auth-brand__logo object,
.auth-brand__logo .platform-asset-svg {
    display: block;
    width: min(480px, 88vw) !important;
    height: auto !important;
    max-width: 480px;
    max-height: none;
    object-fit: contain;
    object-position: left center;
}

.auth-brand__title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 0 0 14px;
    color: #f8fafc;
}

[data-theme="light"] .auth-brand__title {
    color: #1e293b;
}

.auth-brand__lead {
    margin: 0;
    max-width: 38ch;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--auth-text-soft);
}

.auth-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    background: var(--auth-chip-bg);
    border: 1px solid var(--auth-chip-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="light"] .auth-chip {
    color: #334155;
}

.auth-chip i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 12px;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.14);
}

[data-theme="light"] .auth-chip i {
    color: #2563eb;
    background: rgba(59, 130, 246, 0.1);
}

.auth-brand__footer {
    flex-shrink: 0;
    padding-top: 16px;
    text-align: left;
}

.auth-brand__footer .platform-support {
    display: none;
}

.auth-brand__footer .platform-support__item {
    font-size: 12px;
    color: var(--auth-text-soft);
    text-decoration: none;
}

.auth-brand__footer .platform-support__item:hover {
    color: #93c5fd;
}

[data-theme="light"] .auth-brand__footer .platform-support__item:hover {
    color: #2563eb;
}

.auth-brand__footer .platform-legal__item {
    font-size: 12px;
    color: var(--auth-text-soft);
}

/* ── Zona do formulário ──────────────────────────────── */
.auth-form-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 72px 40px 24px;
    min-height: 0;
    overflow: hidden;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 28px 28px 24px;
    border-radius: 24px;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    box-shadow: var(--auth-card-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.auth-card__mobile-logo {
    display: none;
    margin-bottom: 20px;
}

.auth-topbar .theme-float {
    position: static;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--auth-chip-bg);
    border: 1px solid var(--auth-chip-border);
    color: var(--auth-text-soft);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 14px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.auth-topbar .theme-float:hover {
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .auth-topbar .theme-float:hover {
    color: #2563eb;
    background: #fff;
}

.auth-card__mobile-logo img,
.auth-card__mobile-logo object,
.auth-card__mobile-logo .platform-asset-svg {
    width: min(160px, 50vw) !important;
    height: auto !important;
    max-height: 52px;
}

/* Segmented tabs */
.auth-segments {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 5px;
    margin-bottom: 28px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--auth-chip-border);
}

[data-theme="light"] .auth-segments {
    background: rgba(15, 23, 42, 0.04);
}

.auth-segment {
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: var(--auth-text-soft);
    transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.auth-segment:hover {
    color: #e2e8f0;
    text-decoration: none;
}

[data-theme="light"] .auth-segment:hover {
    color: #0f172a;
}

.auth-segment.is-active {
    color: #f8fafc;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

[data-theme="light"] .auth-segment.is-active {
    color: #fff;
}

.auth-panel {
    display: none;
}

.auth-panel.is-active {
    display: block;
}

.auth-panel__title {
    margin: 0 0 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

[data-theme="light"] .auth-panel__title {
    color: #0f172a;
}

.auth-panel__sub {
    margin: 0 0 22px;
    font-size: 13px;
    color: var(--auth-text-soft);
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field__label {
    display: block;
    margin-bottom: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--auth-text-soft);
}

.auth-field__wrap {
    position: relative;
}

.auth-field__wrap .auth-field__input {
    padding-left: 40px;
}

.auth-segments:has(.auth-segment:only-child) {
    grid-template-columns: 1fr;
}

.auth-field__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--auth-text-soft);
    pointer-events: none;
}

.auth-field__input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--auth-chip-border);
    background: rgba(255, 255, 255, 0.04);
    color: #f1f5f9;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

[data-theme="light"] .auth-field__input {
    background: #fff;
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.1);
}

.auth-field__input:focus {
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.auth-field__input::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

.auth-field__input.is-invalid {
    border-color: rgba(239, 68, 68, 0.5);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.auth-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--auth-text-soft);
    cursor: pointer;
}

.auth-row label input {
    accent-color: #3b82f6;
}

.auth-row a {
    font-size: 12px;
    font-weight: 600;
    color: #60a5fa;
    text-decoration: none;
}

.auth-row a:hover {
    color: #93c5fd;
}

.auth-submit {
    width: 100%;
    padding: 13px 18px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.42);
}

.auth-card__register {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--auth-chip-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.auth-card__register-label {
    font-size: 12px;
    color: var(--auth-text-soft);
}

.auth-register-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    color: #60a5fa;
    background: transparent;
    border: 1px solid rgba(59, 130, 246, 0.35);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.auth-register-btn:hover {
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(59, 130, 246, 0.08);
    text-decoration: none;
}

[data-theme="light"] .auth-register-btn {
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.35);
}

[data-theme="light"] .auth-register-btn:hover {
    background: rgba(59, 130, 246, 0.06);
}

.auth-footnote {
    margin-top: 18px;
    text-align: center;
    font-size: 12px;
    color: var(--auth-text-soft);
}

.auth-footnote a {
    color: #60a5fa;
    font-weight: 600;
    text-decoration: none;
}

.auth-alert {
    margin-bottom: 16px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.45;
}

.auth-alert--success {
    color: #86efac;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.22);
}

[data-theme="light"] .auth-alert--success {
    color: #15803d;
}

.auth-alert--danger {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.22);
}

.auth-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.register-legal-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 8px 0 16px;
    font-size: 12px;
    color: var(--auth-text-soft);
    line-height: 1.45;
}

.register-legal-check a {
    color: #60a5fa;
}

.invalid-feedback {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #fca5a5;
}

[data-theme="light"] .invalid-feedback {
    color: #dc2626;
}

/* ── Responsivo ──────────────────────────────────────── */
@media (max-width: 1024px) {
    .auth-main {
        grid-template-columns: 1fr;
        overflow: hidden;
    }

    .auth-brand {
        padding: 72px 28px 16px;
    }

    .auth-form-zone {
        padding: 0 24px 24px;
        align-items: center;
    }

    .auth-card {
        max-width: 520px;
    }
}

@media (max-width: 720px) {
    .auth-brand {
        display: none;
    }

    .auth-topbar {
        padding: 14px 16px;
    }

    .auth-topbar__register {
        padding: 8px 12px;
        font-size: 11px;
    }

    .auth-form-zone {
        padding: 64px 16px 20px;
        align-items: center;
    }

    .auth-card {
        padding: 22px 18px 20px;
        border-radius: 20px;
    }

    .auth-card__mobile-logo {
        display: block;
    }

    .auth-cols {
        grid-template-columns: 1fr;
    }
}
