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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    background: color-mix(in srgb, var(--primary, #10b981) 7%, #04070a);
    position: relative;
    /* Rolagem vertical liberada (form de 8 campos não pode ser cortado em tela baixa /
       zoom / paisagem); horizontal escondido pra os orbs não gerarem scroll lateral. */
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px 0;
}

/* ── Animated gradient orbs ── */
body::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary, #10b981) 18%, transparent), transparent 70%);
    top: -200px;
    left: -100px;
    animation: orbFloat1 8s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary-light, var(--primary, #10b981)) 12%, transparent), transparent 70%);
    bottom: -150px;
    right: -100px;
    animation: orbFloat2 10s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes orbFloat1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.1); }
}

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

/* ── Dot grid pattern ── */
.register-bg-pattern {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: drift 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

/* ── Container / Card ── */
.container {
    background: rgba(10, 20, 15, 0.85);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    padding: 48px 46px 40px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #fff;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 120px rgba(16, 185, 129, 0.04);
    width: 480px;
    margin: auto; /* centraliza quando cabe e permite rolar até o topo quando não cabe */
    position: relative;
    z-index: 1;
    animation: cardFloat 0.8s ease-out;
}

@keyframes cardFloat {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalAnim {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Header do formulario ── */
.form-header {
    text-align: center;
    margin-bottom: 28px;
}

.form-logo {
    /* largura automatica: serve logos quadradas e horizontais (wordmark) */
    height: 76px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
    filter: drop-shadow(0 0 24px color-mix(in srgb, var(--primary, #10b981) 25%, transparent));
}

.container h1 {
    font-size: 28px;
    text-align: center;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #fff 30%, var(--primary-light, #6ee7b7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    letter-spacing: 0.5px;
}


/* ── Inputs ── */
.input-box {
    position: relative;
    margin-bottom: 14px;
    width: 100%;
}

.input-box input {
    width: 100%;
    height: 52px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    outline: none;
    color: #fff;
    padding: 0 44px 0 18px;
    font-size: 14px;
    font-family: inherit;
    transition: background-color 0.3s, border-color 0.3s;
}

.input-box input:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: color-mix(in srgb, var(--primary, #10b981) 50%, transparent);
    box-shadow: 0 0 24px color-mix(in srgb, var(--primary, #10b981) 12%, transparent),
                0 0 0 3px color-mix(in srgb, var(--primary, #10b981) 6%, transparent);
}

.input-box input::placeholder {
    color: rgba(255, 255, 255, 0.55); /* contraste AA */
}

.input-box i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.45);
    font-size: 18px;
    transition: color 0.3s;
    pointer-events: none;
}

.input-box input:focus + i {
    color: var(--primary, #10b981);
}

/* ── Botão mostrar/ocultar senha (focável por teclado) ── */
.input-box button.toggle-senha {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    padding: 0;
}
.input-box button.toggle-senha i { position: static; transform: none; pointer-events: none; color: inherit; font-size: 18px; }
.input-box button.toggle-senha:hover { color: var(--primary, #10b981); }

/* ── Foco visível por teclado (WCAG 2.4.7) ── */
.btn-register:focus-visible,
.input-box input:focus-visible,
.input-box button.toggle-senha:focus-visible,
.register-link a:focus-visible,
.terms a:focus-visible,
input[type="checkbox"]:focus-visible {
    outline: 3px solid var(--primary-light, #34d399);
    outline-offset: 2px;
}

/* ── Linha de inputs lado a lado ── */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.input-row .input-box {
    margin-bottom: 14px;
}

/* ── CNPJ Info/Loading/Erro ── */
.cnpj-info {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 4px;
    margin: -6px 0 14px;
    animation: fadeIn 0.3s ease;
}

.cnpj-info-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cnpj-info i {
    color: var(--primary, #10b981);
    font-size: 18px;
    flex-shrink: 0;
}

.cnpj-info span {
    font-size: 13px;
    color: var(--primary-light, #6ee7b7);
    font-weight: 500;
    line-height: 1.3;
}

.cnpj-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: -6px 0 14px;
    animation: fadeIn 0.3s ease;
}

.cnpj-loading span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.cnpj-aviso {
    display: flex;
    padding: 12px 14px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 4px;
    margin: -6px 0 14px;
    animation: fadeIn 0.3s ease;
}

.cnpj-aviso-inner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cnpj-aviso-inner > i {
    color: #f59e0b;
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.cnpj-aviso-titulo {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #f59e0b;
    margin-bottom: 2px;
}

.cnpj-aviso-desc {
    display: block;
    font-size: 12px;
    color: rgba(245, 158, 11, 0.7);
    line-height: 1.4;
}

/* ── Spinner ── */
.spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(16, 185, 129, 0.2);
    border-top-color: var(--primary, #10b981);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

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

/* ── Balão de requisitos da senha ── */
.senha-reqs {
    position: relative;
    background: rgba(10, 20, 15, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 12px 14px;
    margin: -4px 0 12px;
    font-size: 12.5px;
    animation: fadeIn 0.2s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
/* setinha apontando para o campo de senha (acima) */
.senha-reqs::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 22px;
    width: 11px;
    height: 11px;
    background: rgba(10, 20, 15, 0.97);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    transform: rotate(45deg);
}
.senha-reqs-titulo {
    margin: 0 0 8px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}
.senha-reqs ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.senha-reqs li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s;
}
.senha-reqs li i {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.2s;
}
.senha-reqs li.ok { color: #22c55e; }
.senha-reqs li.ok i { color: #22c55e; }

/* ── Forca da senha ── */
.senha-forca {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -6px 0 10px;
    padding: 0 4px;
}

.forca-barra {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.forca-progresso {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s, background 0.3s;
}

.forca-texto {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}

/* ── Terms ── */
.terms {
    font-size: 12px;
    margin: 16px 0;
}

.terms label {
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    display: flex;
    align-items: flex-start; /* checkbox alinhado ao topo do texto (que pode ter 2 linhas) */
    gap: 8px;
    line-height: 1.45;
    transition: color 0.3s;
}

.terms label:hover {
    color: #fff;
}

/* o texto+links num único <span> flui como texto normal e quebra linha corretamente */
.terms label span { flex: 1; }

.terms label input {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--primary, #10b981);
    flex-shrink: 0;      /* o checkbox não encolhe */
    margin-top: 1px;
}

.terms a {
    color: var(--primary, #10b981);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap; /* "Termos de Serviço" e "Política de Privacidade" não quebram no meio */
}
.terms a:hover { text-decoration: underline; }

/* ── Botoes ── */
.btn-register {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, var(--primary, #10b981), var(--primary-dark, #059669));
    border: none;
    outline: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    margin-top: 8px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px color-mix(in srgb, var(--primary, #10b981) 15%, transparent);
}

.btn-register::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px color-mix(in srgb, var(--primary, #10b981) 45%, transparent),
                0 0 60px color-mix(in srgb, var(--primary, #10b981) 15%, transparent);
}

.btn-register:hover::before { left: 100%; }
.btn-register:active { transform: translateY(0); }

.btn-register:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}


/* ── Link de login ── */
.register-link {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.register-link p {
    color: rgba(255, 255, 255, 0.45);
}

.register-link a {
    color: var(--primary, #10b981);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.register-link a:hover {
    color: var(--primary-light, #34d399);
    text-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

/* ── Mensagem de sucesso ── */
.success-message {
    text-align: center;
    color: #fff;
    padding: 40px 20px;
    animation: fadeIn 0.6s ease-out;
}

.success-message i {
    font-size: 70px;
    color: var(--primary, #10b981);
    margin-bottom: 25px;
    display: block;
    animation: bounce 0.6s ease-out;
}

@keyframes bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-message h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--primary-light, #6ee7b7);
    font-weight: 600;
}

.success-message p {
    font-size: 14px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

.success-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(16, 185, 129, 0.2);
    border-top-color: var(--primary, #10b981);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto 0;
}

/* ── Responsividade ── */
@media (max-width: 540px) {
    /* font-size >= 16px evita o zoom automático do Safari iOS ao focar o campo. */
    .input-box input { font-size: 16px; }

    .container {
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        border-radius: 0;
        padding: 28px 28px calc(28px + env(safe-area-inset-bottom, 0px));
        display: flex;
        flex-direction: column;
        justify-content: center;
        border: none;
        background: rgba(255, 255, 255, 0.02);
        box-shadow: none;
    }

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

    .form-logo {
        height: 60px;
        width: auto;
        max-width: 190px;
    }

    .input-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
