/* ================================================================
   ATLAS — REGISTRO STYLE  (redesign v2 — padrão login)
================================================================ */

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

:root {
    --blue:      #5b8ef5;
    --blue-dim:  rgba(91,142,245,0.10);
    --bg:        #080f1d;
    --surface:   #0d1626;
    --border:    rgba(255,255,255,0.07);
    --border-h:  rgba(91,142,245,0.35);
    --text:      rgba(255,255,255,0.90);
    --muted:     rgba(160,190,235,0.50);
    --error:     #f87171;
    --success:   #34d399;
}

html { height: 100%; }

body {
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    cursor: none;
}

/* ── Canvas ── */
#bgCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ── Cursor ── */
.cursor {
    position: fixed;
    width: 8px; height: 8px;
    background: var(--blue);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%,-50%);
    transition: width .2s, height .2s;
}
.cursor-ring {
    position: fixed;
    width: 30px; height: 30px;
    border: 1px solid rgba(91,142,245,0.3);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%,-50%);
    transition: all .12s ease;
}

/* ── Layout ── */
.register-page {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 20px;
}

/* ── Card ── */
.register-card {
    width: 100%;
    max-width: 540px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 32px;
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 80px rgba(0,0,0,0.45);
    animation: cardIn 0.4s cubic-bezier(.22,1,.36,1) both;
}

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

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

.register-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--blue);
    border: 1px solid rgba(91,142,245,0.22);
    border-radius: 20px;
    padding: 4px 14px;
    margin-bottom: 16px;
    background: var(--blue-dim);
}

.register-header h1 {
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.register-header p {
    font-size: 0.82rem;
    color: var(--muted);
}

/* ── Alert erro ── */
.alert-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.2);
    margin-bottom: 18px;
    font-size: 0.78rem;
    color: #fca5a5;
    animation: shakeX 0.4s ease;
}
.alert-error svg { width: 16px; height: 16px; flex-shrink: 0; }

@keyframes shakeX {
    0%,100%  { transform: translateX(0); }
    20%,60%  { transform: translateX(-6px); }
    40%,80%  { transform: translateX(6px); }
}

/* ── Section label ── */
.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--blue);
    margin: 24px 0 14px;
    text-transform: uppercase;
}
.section-label span {
    width: 20px; height: 20px;
    border: 1px solid rgba(91,142,245,0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    background: var(--blue-dim);
    flex-shrink: 0;
}
.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Grid de campos ── */
.fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.field-group { display: flex; flex-direction: column; }
.field-group.full { grid-column: span 2; }
.field-group.half { grid-column: span 1; }

/* ── Labels ── */
.field-group label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(160,190,235,0.5);
    margin-bottom: 7px;
}

/* ── Inputs ── */
.field-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color .2s, box-shadow .2s;
}
.field-wrap:focus-within {
    border-color: rgba(91,142,245,0.4);
    box-shadow: 0 0 0 3px rgba(91,142,245,0.08);
}
.field-wrap.has-error {
    border-color: rgba(248,113,113,0.35);
    box-shadow: 0 0 0 3px rgba(248,113,113,0.06);
}

.field-icon {
    width: 15px; height: 15px;
    margin-left: 14px;
    flex-shrink: 0;
    color: rgba(160,190,235,0.28);
    pointer-events: none;
}

.field-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 12px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: var(--text);
    width: 100%;
}
.field-wrap input[type="date"] { color-scheme: dark; }
.field-wrap input::placeholder { color: rgba(160,190,235,0.18); }

.eye-btn {
    background: none;
    border: none;
    cursor: none;
    padding: 0 14px;
    color: rgba(160,190,235,0.28);
    display: flex;
    align-items: center;
    transition: color .2s;
}
.eye-btn:hover { color: var(--blue); }
.eye-btn svg { width: 15px; height: 15px; }

.field-error {
    display: block;
    font-size: 0.68rem;
    color: var(--error);
    margin-top: 5px;
    padding-left: 2px;
    min-height: 14px;
}

/* ── Radio group ── */
.radio-group {
    display: flex;
    gap: 12px;
    padding: 11px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: none;
    font-size: 0.78rem;
    color: var(--muted);
    user-select: none;
}
.radio-label input[type="radio"] { display: none; }
.radio-box {
    width: 16px; height: 16px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .2s;
}
.radio-label input:checked + .radio-box {
    border-color: var(--blue);
    background: var(--blue-dim);
}
.radio-label input:checked + .radio-box::after {
    content: '';
    width: 7px; height: 7px;
    background: var(--blue);
    border-radius: 50%;
}

/* ── Botão Criar Conta ── */
.btn-register {
    width: 100%;
    margin-top: 24px;
    padding: 13px;
    background: transparent;
    border: 1px solid rgba(91,142,245,0.45);
    border-radius: 10px;
    color: var(--blue);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: none;
    transition: background .22s, border-color .22s, color .22s, transform .15s, box-shadow .22s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn-register:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(37,99,235,0.28);
}
.btn-register:active { transform: translateY(0); }
.btn-register:disabled { opacity: 0.4; pointer-events: none; }

/* ── Spinner ── */
.spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(91,142,245,0.2);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login link ── */
.login-link {
    text-align: center;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 20px;
}
.login-link a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
    transition: opacity .2s;
}
.login-link a:hover { opacity: 0.75; }

/* ── Modal sucesso ── */
#modalSucesso {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(8,15,29,0.96);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-scanline {
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--blue), transparent);
    top: -2px;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
}
.modal-scanline.running {
    animation: scanSweep 0.6s cubic-bezier(.4,0,.6,1) forwards;
}
@keyframes scanSweep {
    0%   { top: 0%;   opacity: 1; }
    100% { top: 100%; opacity: 0.3; }
}

.modal-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 480px;
    padding: 0 20px;
    animation: modalFadeUp 0.4s cubic-bezier(.22,1,.36,1) both;
}
@keyframes modalFadeUp {
    from { opacity:0; transform: translateY(16px); }
    to   { opacity:1; transform: translateY(0); }
}

.modal-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.modal-sys-tag {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--blue);
    opacity: 0.6;
}
.modal-session-id {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    color: rgba(160,190,235,0.22);
}

.modal-headline {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 36px;
}
.modal-status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 12px var(--success);
    flex-shrink: 0;
    animation: dotPulse 1.8s ease-in-out infinite;
}
@keyframes dotPulse {
    0%,100% { box-shadow: 0 0 8px var(--success); }
    50%     { box-shadow: 0 0 20px var(--success), 0 0 40px rgba(52,211,153,0.35); }
}
.modal-headline h2 {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    line-height: 1;
}

.modal-checks { display: flex; flex-direction: column; margin-bottom: 32px; }
.modal-check-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.modal-check-row.visible { opacity: 1; transform: translateX(0); }
.chk-icon {
    font-size: 0.7rem;
    color: rgba(160,190,235,0.22);
    width: 14px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.modal-check-row.ok .chk-icon { color: var(--success); }
.chk-label {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(160,190,235,0.45);
    transition: color 0.2s;
}
.modal-check-row.ok .chk-label { color: rgba(255,255,255,0.75); }
.chk-val {
    font-size: 0.62rem;
    color: rgba(160,190,235,0.15);
    letter-spacing: 0.08em;
    transition: color 0.2s;
}
.modal-check-row.ok .chk-val { color: var(--success); opacity: 0.8; }

.modal-divider { height: 1px; background: var(--border); margin-bottom: 24px; }

.modal-redirect { display: flex; align-items: center; gap: 14px; }
.modal-redirect-label {
    font-size: 0.62rem;
    color: rgba(160,190,235,0.28);
    letter-spacing: 0.1em;
    white-space: nowrap;
}
.modal-bar {
    flex: 1;
    height: 2px;
    background: rgba(91,142,245,0.08);
    border-radius: 2px;
    overflow: hidden;
}
.modal-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--blue));
    width: 0%;
    transition: width 2s linear;
}
.modal-redirect-pct {
    font-size: 0.62rem;
    color: var(--blue);
    letter-spacing: 0.06em;
    width: 28px;
    text-align: right;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: rgba(91,142,245,0.3);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(91,142,245,0.5); }

/* ── Responsivo ── */
@media (max-width: 560px) {
    .register-card { padding: 28px 20px; }
    .fields-grid { grid-template-columns: 1fr; }
    .field-group.half { grid-column: span 1; }
    .register-header h1 { font-size: 1.2rem; }
}
