* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --azul-escuro: #22243a;
    --azul-base: #02083f;
    --destaque: #e6b45a;
    --cinza-claro: #f2f2f2;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto !important;
}

body {
    min-height: 100vh;
    background: linear-gradient(120deg, #1b1f3b, #22243a, #101535, #02083f);
    background-size: 400% 400%;
    animation: bgAnimado 14s ease infinite;
    position: relative;
    padding: 16px 14px;
}

@media (min-width: 768px) {
    body {
        padding: 12px 14px;
    }
}

@keyframes bgAnimado {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(230, 180, 90, 0.15), transparent 40%),
                radial-gradient(circle at 80% 80%, rgba(2, 8, 63, 0.25), transparent 40%);
    animation: ondasBg 18s linear infinite;
    z-index: 0;
}

@keyframes ondasBg {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-50px, -30px); }
    100% { transform: translate(0, 0); }
}

.cad-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.cad-orb {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    opacity: 0.45;
    filter: blur(4px);
    animation: cadOrb 12s ease-in-out infinite;
    mix-blend-mode: multiply;
}

.cad-orb.orb-1 {
    top: -120px;
    left: -80px;
    background: radial-gradient(circle at 30% 30%, rgba(2, 8, 63, 0.35), rgba(2, 8, 63, 0.1) 60%, transparent 70%);
}

.cad-orb.orb-2 {
    top: 20%;
    right: -140px;
    background: radial-gradient(circle at 70% 30%, rgba(34, 36, 58, 0.35), rgba(34, 36, 58, 0.1) 60%, transparent 70%);
    animation-delay: -6s;
}

.cad-orb.orb-3 {
    bottom: -160px;
    left: 15%;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle at 40% 60%, rgba(230, 180, 90, 0.35), rgba(230, 180, 90, 0.12) 60%, transparent 70%);
    animation-delay: -10s;
}

.cad-orb.orb-4 {
    bottom: -180px;
    right: 10%;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle at 40% 40%, rgba(2, 8, 63, 0.25), rgba(2, 8, 63, 0.08) 60%, transparent 70%);
    animation-delay: -14s;
}

.cad-grid {
    position: absolute;
    inset: -20%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 90px 90px;
    opacity: 0.2;
    transform: perspective(900px) rotateX(55deg);
    animation: cadGrid 18s linear infinite;
}

.cad-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.2) 60%, transparent 70%);
    box-shadow: 0 0 12px rgba(2, 8, 63, 0.25), 0 0 26px rgba(230, 180, 90, 0.25);
    opacity: 0.85;
    animation: cadParticle 7s ease-in-out infinite;
}

.cad-particle.p1 { top: 18%; left: 20%; animation-delay: -1s; }
.cad-particle.p2 { top: 30%; left: 70%; animation-delay: -3s; }
.cad-particle.p3 { top: 62%; left: 12%; animation-delay: -5s; }
.cad-particle.p4 { top: 72%; left: 82%; animation-delay: -7s; }
.cad-particle.p5 { top: 42%; left: 48%; animation-delay: -9s; }
.cad-particle.p6 { top: 82%; left: 30%; animation-delay: -11s; }

@keyframes cadOrb {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.05); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes cadGrid {
    0% { transform: perspective(900px) rotateX(55deg) translateY(0); }
    50% { transform: perspective(900px) rotateX(55deg) translateY(30px); }
    100% { transform: perspective(900px) rotateX(55deg) translateY(0); }
}

@keyframes cadParticle {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(16px, -24px) scale(1.2); }
    100% { transform: translate(0, 0) scale(1); }
}

.container {
    width: min(980px, 96vw);
    max-width: 100%;
    margin: 0 auto;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(2, 8, 63, 0.25);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 255, 0.95));
    box-shadow: 0 26px 70px rgba(6, 12, 45, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.75);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 30px 28px 22px;
    position: relative;
    z-index: 1;
    gap: 12px;
}

.container::-webkit-scrollbar {
    width: 8px;
}

.container::-webkit-scrollbar-thumb {
    background: rgba(2, 8, 63, 0.35);
    border-radius: 999px;
}

.container img {
    width: 140px;
    margin-bottom: 4px;
    margin-top: -26px;
}

.container-tag {
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(2, 8, 63, 0.12), rgba(34, 36, 58, 0.09));
    color: #02083f;
    border: 1px solid rgba(2, 8, 63, 0.22);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 7px 14px;
}

.container h1 {
    color: #02083f;
    font-size: 33px;
    text-align: center;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.container-subtitle {
    color: #4b5563;
    font-size: 14px;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 0;
}

.cadastro-form {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-section {
    display: grid;
    gap: 8px;
    background: linear-gradient(180deg, #ffffff, #f7f9ff);
    border: 1px solid rgba(2, 8, 63, 0.14);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(2, 8, 63, 0.06);
}

.form-section h2 {
    font-size: 13px;
    color: #22243a;
    text-transform: uppercase;
    letter-spacing: 0.9px;
}

.section-hint {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 0;
}

.form-section label {
    color: #1f2937;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.form-section label span {
    color: #b91c1c;
}

.input-wrap {
    position: relative;
}

.input-wrap i {
    color: var(--azul-base);
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
}

.input-wrap input {
    background: #ffffff;
    border: 1px solid rgba(2, 8, 63, 0.28);
    border-radius: 12px;
    width: 100%;
    color: #1f1f1f;
    padding: 12px 12px 12px 38px;
    transition: border .2s ease, box-shadow .2s ease, transform .2s ease;
}

.input-wrap input::placeholder {
    color: rgba(2, 8, 63, 0.55);
}

.input-wrap input:disabled {
    background: #f3f4f6;
    color: #4b5563;
    border-color: rgba(2, 8, 63, 0.2);
    cursor: not-allowed;
}

.input-wrap input:focus {
    outline: none;
    border-color: var(--azul-base);
    box-shadow: 0 0 0 3px rgba(2, 8, 63, 0.15);
    transform: translateY(-1px);
}

.consent-wrap {
    grid-column: 1 / -1;
    margin-top: 4px;
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    padding: 10px 12px;
}

.consent-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    cursor: pointer;
}

.consent-check input {
    margin-top: 1px;
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
    flex: 0 0 auto;
}

.consent-check span {
    flex: 1 1 auto;
}

.consent-check a {
    color: #1e40af;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.consent-check a:hover {
    color: #1e3a8a;
}

.consent-check a:visited {
    color: #1e3a8a;
}

.btn-cadastrar {
    background: linear-gradient(135deg, var(--azul-base), var(--azul-escuro));
    color: #ffffff;
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 999px;
    margin-top: 2px;
    cursor: pointer;
    transition: .3s;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-cadastrar:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(2, 8, 63, 0.25);
}

.cadastro-feedback {
    grid-column: 1 / -1;
    width: 100%;
    background: #ffe5e5;
    color: #a61b1b;
    border: 1px solid rgba(166, 27, 27, 0.25);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    text-align: center;
}

.voltar-login {
    color: var(--azul-base);
    text-decoration: none;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.voltar-login:hover {
    text-decoration: underline;
}

@media (max-width: 520px) {
    body {
        padding: 18px 12px 20px;
    }

    .container {
        border-radius: 16px;
        max-height: calc(100vh - 38px);
        padding: 24px 16px 18px;
    }

    .container img {
        width: 128px;
        margin-top: -30px;
    }

    .container h1 {
        font-size: 26px;
    }

    .container-subtitle {
        font-size: 12px;
    }

    .form-section {
        padding: 12px;
        gap: 7px;
    }

    .cadastro-form {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .input-wrap input {
        font-size: 16px;
        padding: 11px 12px 11px 38px;
    }
}

@media (min-width: 900px) {
    .container {
        width: min(980px, 95vw);
        max-height: calc(100vh - 20px);
        padding: 30px 30px 22px;
    }

    .cadastro-form .btn-cadastrar {
        grid-column: 1 / -1;
    }
}

/* Cadastro layout alinhado ao login */
body.cadastro-page {
    font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 !important;
}

body.cadastro-page .login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 560px);
    align-items: center;
    gap: 36px;
    padding: 28px;
    position: relative;
    z-index: 1;
    max-width: 1360px;
    margin: 0 auto;
}

body.cadastro-page .login-brand-panel {
    align-self: stretch;
    min-height: 420px;
    border-radius: 20px;
    padding: 40px;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.7), rgba(30, 41, 59, 0.46));
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.32);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    color: #e2e8f0;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

body.cadastro-page .login-brand-panel::before {
    content: "";
    position: absolute;
    width: 340px;
    height: 148px;
    left: 50%;
    top: 48px;
    transform: translateX(-50%);
    border-radius: 999px;
    background:
        radial-gradient(circle at 50% 50%, rgba(147, 197, 253, 0.28), rgba(147, 197, 253, 0.04) 58%, transparent 74%),
        conic-gradient(from 0deg, rgba(147, 197, 253, 0.45), rgba(56, 189, 248, 0.12), rgba(147, 197, 253, 0.45));
    filter: blur(10px);
    opacity: 0.82;
    animation: logoAuraSpinCadastro 8s linear infinite;
    z-index: 0;
    pointer-events: none;
}

body.cadastro-page .login-brand-panel::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 120%;
    left: -260px;
    top: -10%;
    transform: rotate(18deg);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(147, 197, 253, 0.18), rgba(255, 255, 255, 0));
    animation: logoSweepCadastro 4.6s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

body.cadastro-page .login-brand-panel > * {
    position: relative;
    z-index: 2;
}

body.cadastro-page .login-brand-panel,
body.cadastro-page .login-brand-panel * {
    color: #e2e8f0 !important;
}

body.cadastro-page .login-brand-logo {
    width: min(620px, 88%);
    max-height: 260px;
    height: auto;
    margin: 0 auto 8px;
    display: block;
    object-fit: contain;
    transform: none;
    opacity: 1;
    filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.42));
    animation: none;
}

@keyframes logoShowcaseAuthCadastro {
    0%,
    100% {
        transform: translateY(0) scale(1.16) rotate(-0.8deg);
    }
    25% {
        transform: translateY(-4px) scale(1.185) rotate(0.8deg);
    }
    50% {
        transform: translateY(-8px) scale(1.205) rotate(0deg);
    }
    75% {
        transform: translateY(-3px) scale(1.175) rotate(-0.6deg);
    }
}

@keyframes logoPulseAuthCadastro {
    0%,
    100% {
        filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 22px rgba(147, 197, 253, 0.28));
    }
    50% {
        filter: drop-shadow(0 22px 42px rgba(0, 0, 0, 0.52)) drop-shadow(0 0 42px rgba(147, 197, 253, 0.62));
    }
}

@keyframes logoAuraSpinCadastro {
    0% {
        transform: translateX(-50%) rotate(0deg);
    }
    100% {
        transform: translateX(-50%) rotate(360deg);
    }
}

@keyframes logoSweepCadastro {
    0%,
    100% {
        left: -260px;
        opacity: 0;
    }
    35% {
        opacity: 0.9;
    }
    60% {
        left: calc(100% + 40px);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.cadastro-page .login-brand-panel::before,
    body.cadastro-page .login-brand-panel::after,
    body.cadastro-page .login-brand-logo {
        animation: none !important;
    }
}

body.cadastro-page .login-brand-panel h2 {
    font-size: clamp(24px, 2.6vw, 34px);
    line-height: 1.2;
    letter-spacing: -0.01em;
    font-weight: 800;
    color: #f8fafc !important;
}

body.cadastro-page .login-brand-panel p {
    color: rgba(226, 232, 240, 0.95);
    font-size: 15px;
    line-height: 1.55;
}

body.cadastro-page .login-brand-panel ul {
    list-style: none;
    display: grid;
    gap: 10px;
    color: rgba(226, 232, 240, 0.98);
    font-size: 14px;
    font-weight: 500;
}

body.cadastro-page .login-brand-panel li {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.cadastro-page .login-brand-panel li i {
    color: #93c5fd !important;
}

body.cadastro-page .login-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.cadastro-page .container {
    width: min(560px, 100%);
    margin: 0;
    max-height: none;
    overflow: visible;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.96));
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    padding: 10px 30px 24px;
    gap: 10px;
}

body.cadastro-page .container img {
    width: clamp(170px, 19vw, 220px);
    height: auto;
    margin: -42px auto -24px;
    display: block;
    filter: drop-shadow(0 10px 22px rgba(15, 23, 42, 0.22)) drop-shadow(0 0 20px rgba(59, 130, 246, 0.15));
    animation: none;
}

body.cadastro-page .container-tag {
    background: #e2e8f0;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
}

body.cadastro-page .container h1 {
    color: #0f172a;
    font-size: clamp(24px, 2.2vw, 28px);
    font-weight: 800;
    letter-spacing: -0.01em;
}

body.cadastro-page .container-subtitle {
    font-size: 14px;
    color: #525a68;
}

body.cadastro-page .cadastro-form {
    width: 100%;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

body.cadastro-page .form-section {
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    box-shadow: none;
    padding: 14px;
    gap: 8px;
}

body.cadastro-page .form-section h2 {
    font-size: 12px;
    color: #334155;
}

body.cadastro-page .section-hint {
    font-size: 12px;
    color: #64748b;
}

body.cadastro-page .form-section label {
    font-size: 13px;
    color: #334155;
}

body.cadastro-page .input-wrap i {
    color: #64748b;
}

body.cadastro-page .input-wrap input {
    border: 1px solid #334155;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    padding: 11px 12px 11px 38px;
    font-size: 14px;
}

body.cadastro-page .input-wrap input::placeholder {
    color: #94a3b8;
}

body.cadastro-page .input-wrap input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    transform: none;
}

body.cadastro-page .btn-cadastrar {
    margin-top: 4px;
    min-height: 50px;
    border-radius: 12px;
    border: 0;
    background: #2563eb;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
}

body.cadastro-page .btn-cadastrar:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

body.cadastro-page .consent-check {
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
}

body.cadastro-page .consent-wrap {
    background: #f8fafc;
    border-color: #cbd5e1;
}

body.cadastro-page .cadastro-feedback {
    border-radius: 12px;
    border: 1px solid rgba(198, 40, 40, 0.24);
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
}

body.cadastro-page .voltar-login {
    color: #1e3a8a;
    font-weight: 600;
    margin-top: 2px;
}

body.cadastro-page .voltar-login:hover {
    color: #1d4ed8;
    text-decoration: none;
}

@media (max-width: 1040px) {
    body.cadastro-page .login-shell {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 20px;
        min-height: auto;
    }

    body.cadastro-page .login-brand-panel {
        display: none;
    }

    body.cadastro-page .login-wrapper {
        max-width: 560px;
        margin: 0 auto;
    }
}

@media (max-width: 520px) {
    body.cadastro-page .login-shell {
        padding: 12px;
    }

    body.cadastro-page .container {
        border-radius: 16px;
        width: 100%;
        max-width: 100%;
        padding: 10px 16px 16px;
        gap: 8px;
    }

    body.cadastro-page .container img {
        margin: -32px auto -18px;
    }

    body.cadastro-page .container h1 {
        font-size: clamp(24px, 7.2vw, 32px);
        line-height: 1.14;
        text-align: center;
    }

    body.cadastro-page .container-subtitle {
        text-align: center;
        font-size: 13px;
    }

    body.cadastro-page .form-section {
        padding: 12px;
        border-radius: 12px;
    }

    body.cadastro-page .form-section h2 {
        font-size: 11px;
        letter-spacing: 0.08em;
    }

    body.cadastro-page .section-hint {
        font-size: 11px;
    }

    body.cadastro-page .form-section label {
        font-size: 12px;
    }

    body.cadastro-page .input-wrap input {
        font-size: 16px;
        min-height: 46px;
    }

    body.cadastro-page .btn-cadastrar {
        min-height: 48px;
        font-size: 15px;
    }

    body.cadastro-page .consent-check {
        align-items: flex-start;
        gap: 8px;
        font-size: 12px;
        line-height: 1.4;
    }

    body.cadastro-page .consent-check span {
        word-break: break-word;
    }

    body.cadastro-page .voltar-login {
        justify-content: center;
        text-align: center;
    }
}

/* Evita zoom automatico no iOS ao focar campos de formulario */
@media (min-width: 521px) and (max-width: 768px) {
    body.cadastro-page .login-shell {
        min-height: 100dvh;
        align-items: flex-start;
        padding: 16px;
    }

    body.cadastro-page .login-wrapper {
        width: 100%;
        max-width: 640px;
    }

    body.cadastro-page .container {
        width: min(100%, 640px);
    }

    body.cadastro-page .container img {
        width: clamp(138px, 41vw, 184px);
    }

    body.cadastro-page .cadastro-form {
        gap: 10px;
    }

    body.cadastro-page .input-wrap {
        width: 100%;
    }

    body.cadastro-page .input-wrap input {
        font-size: 16px;
        min-height: 46px;
        width: 100%;
        padding-left: 36px;
    }

    body.cadastro-page .input-wrap i {
        left: 12px;
        font-size: 14px;
    }

    body.cadastro-page .input-wrap.has-toggle input {
        padding-right: 44px;
    }

    body.cadastro-page .btn-cadastrar,
    body.cadastro-page .voltar-login {
        width: 100%;
    }
}

@media (max-width: 390px) {
    body.cadastro-page .login-shell {
        padding: 10px;
    }

    body.cadastro-page .container {
        border-radius: 14px;
        padding: 8px 12px 14px;
    }

    body.cadastro-page .container img {
        margin: -24px auto -14px;
    }

    body.cadastro-page .container-tag {
        font-size: 11px;
        padding: 5px 10px;
    }

    body.cadastro-page .form-section {
        padding: 10px;
    }

    body.cadastro-page .btn-cadastrar {
        min-height: 46px;
        font-size: 14px;
    }
}
