/* ===========================
   VULON AUTH — REGISTRATION STYLES
   Matches home (index) palette exactly
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');

/* ===========================
   BODY
   =========================== */
body.auth-page {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #4a0e6e;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    color: #fff;
}

/* Gradient background — same purple family as home menu cards */
body.auth-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg,
        #3a0856 0%,
        #4a0e6e 30%,
        #6d2a94 70%,
        #9150c0 100%
    );
    z-index: -1;
}

/* ===========================
   AUTH CONTAINER
   =========================== */
.auth-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    background: transparent;
    /* safe-area-inset-top: logo/titulo nao ficam atras do status bar /
       notch. O rodape (.step-footer) ja trata o inset-bottom. */
    padding-top: var(--sat, env(safe-area-inset-top, 0px));
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Keep all children above ::before */
.step-progress-bar,
.step-header,
.form-step,
.step-footer { position: relative; z-index: 1; }

/* ===========================
   PROGRESS BAR
   =========================== */
.step-progress-bar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    z-index: 60;
    display: none;
}

.progress-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    width: 100%;
    border-radius: 0 0 4px 4px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed 0%, #bd9bff 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(189, 155, 255, 0.6);
}

/* ===========================
   STEP HEADER
   =========================== */
.step-header {
    padding: 28px 25px 10px;
    display: none;
    align-items: center;
    gap: 15px;
    min-height: 78px;
}

.back-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.back-btn:hover { background: rgba(255, 255, 255, 0.22); }

.step-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===========================
   STEP RING (circular progress)
   =========================== */
.step-ring { flex-shrink: 0; }

.step-ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 3.5;
}

.step-ring-fill {
    fill: none;
    stroke: #fff;
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.4s ease;
}

.step-ring-pct {
    fill: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 9px;
    font-weight: 700;
}

.step-number {
    font-size: 0.7rem;
    opacity: 0.55;
    font-weight: 600;
    margin-bottom: 2px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.step-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* ===========================
   FORM STEPS
   =========================== */
.form-step {
    display: none;
    flex-direction: column;
    flex: 1;
    animation: slideInRight 0.25s ease;
}

.form-step.active { display: flex; }
.form-step.slide-back { animation: slideInLeft 0.25s ease; }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(22px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-22px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ===========================
   FORM BODY
   =========================== */
.form-body {
    /* Antes: flex:1 + padding-bottom:120px compensava o step-footer
     * fixo no rodape. Agora o footer eh relative — flex natural ja
     * basta. */
    padding: 10px 25px 16px;
}

.form-description {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 26px;
    line-height: 1.6;
    font-weight: 400;
}

.form-group { margin-bottom: 20px; }

.input-with-icon { position: relative; }
.input-with-icon .vulon-input  { padding-right: 46px; }
.input-with-icon .vulon-select { padding-right: 46px; }

.input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.4;
    font-size: 1.05rem;
    pointer-events: none;
}

/* Botões clicáveis (toggle senha, etc.) sobrescrevem pointer-events */
button.input-icon {
    pointer-events: auto;
    cursor: pointer;
    background: none;
    border: 0;
    color: inherit;
    padding: 4px;
}
button.input-icon:hover { opacity: 0.8; }

/* Options do <select> precisam de cor própria — herdam color:#fff
   do .vulon-input e somem no fundo branco do dropdown nativo */
select.vulon-input option,
.vulon-input option {
    color: #1a1a1a;
    background: #fff;
}

/* ===========================
   FORM LABELS
   =========================== */
.form-label-vulon {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 7px;
    display: block;
    letter-spacing: 0.1px;
}

/* ===========================
   INPUTS & SELECTS
   =========================== */
.vulon-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    color: #fff;
    padding: 14px 16px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    width: 100%;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.vulon-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
    font-weight: 400;
}

.vulon-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.15);
}

.vulon-input.is-invalid { border-color: #ff6b6b; }

.vulon-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.4);
    cursor: pointer;
}

.vulon-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    color: #fff;
    padding: 14px 16px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    width: 100%;
    transition: border-color 0.2s ease;
    appearance: none;
    cursor: pointer;
}

.vulon-select option { background-color: #6d2a94; color: #fff; }

.vulon-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.75);
}

/* ===========================
   FIELD ERRORS
   =========================== */
.field-error {
    font-size: 0.76rem;
    color: #ff8a8a;
    margin-top: 5px;
    display: none;
    font-weight: 500;
}

.field-error.show { display: block; }

/* ===========================
   BUTTONS
   =========================== */
.btn-vulon-primary {
    background: #fff;
    color: #4a0e6e;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 0.97rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
    display: block;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.btn-vulon-primary:hover {
    background: #f0e8f8;
    color: #4a0e6e;
    transform: translateY(-2px);
    box-shadow: 0 7px 22px rgba(0, 0, 0, 0.22);
    text-decoration: none;
}

.btn-vulon-primary:active { transform: translateY(0); }

.btn-vulon-outline {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    padding: 15px 32px;
    border-radius: 50px;
    font-size: 0.97rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    display: block;
    text-align: center;
    text-decoration: none;
}

.btn-vulon-outline:hover {
    border-color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

/* ===========================
   STEP FOOTER
   =========================== */
/* Antes: position:fixed bottom:0 — quando o teclado do Android abria,
 * o viewport reduzia e o footer "subia" cobrindo campos do form.
 * Agora: fluxo natural — botao fica no fim do scroll do conteudo.
 * Usuario rola pra ver. */
.step-footer {
    position: relative;
    width: 100%;
    padding: 24px 25px 32px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0));
    background: transparent;
}

/* ===========================
   WELCOME STEP
   =========================== */
.welcome-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 32px 90px;
    text-align: center;
}

/* Logo — mix-blend-mode elimina fundo branco do PNG */
.welcome-logo { margin-bottom: 44px; }

.welcome-logo-img {
    width: 170px;
    max-width: 62vw;
    display: block;
    margin: 0 auto;
    mix-blend-mode: screen;
}

/* Welcome text */
.welcome-headline {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.8px;
    margin-bottom: 14px;
    line-height: 1.18;
    color: #fff;
}

.welcome-subtitle {
    font-size: 0.93rem;
    color: rgba(255, 255, 255, 0.62);
    margin-bottom: 50px;
    line-height: 1.6;
    max-width: 280px;
    font-weight: 400;
}

.welcome-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Feature badges */
.welcome-features {
    margin-top: 50px;
    display: flex;
    gap: 26px;
    justify-content: center;
    opacity: 0.55;
}

.welcome-feature {
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.45;
    font-weight: 500;
}

.welcome-feature i {
    font-size: 1.3rem;
    display: block;
    margin-bottom: 5px;
}

/* ===========================
   OPTION CARDS
   =========================== */
.option-card {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    user-select: none;
}

.option-card:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.11);
}

.option-card.selected {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.option-card input[type="radio"],
.option-card input[type="checkbox"] { display: none; }

.option-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.option-card.selected .option-radio {
    border-color: #fff;
    background: #fff;
}

.option-card.selected .option-radio::after {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4a0e6e;
}

.option-text { flex: 1; }

.option-label {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
}

.option-desc {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
    font-weight: 400;
}

/* ===========================
   OTP / SMS CODE
   =========================== */
.otp-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 28px 0;
}

.otp-input {
    width: 46px;
    height: 58px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    color: #fff;
    transition: border-color 0.2s ease, background 0.2s ease;
    -moz-appearance: textfield;
}

.otp-input::-webkit-inner-spin-button,
.otp-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.otp-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.16);
}

.otp-input.filled {
    border-color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.14);
}

.resend-section { text-align: center; margin-top: 18px; }

.resend-timer {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 10px;
    font-weight: 500;
}

.btn-resend {
    background: none;
    border: none;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-resend:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    text-decoration: none;
}

/* ===========================
   FILE UPLOAD
   =========================== */
.upload-area {
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px dashed rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.11);
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-area i {
    font-size: 2.2rem;
    opacity: 0.5;
    margin-bottom: 10px;
    display: block;
}

.upload-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.upload-subtitle {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}

.upload-area.uploaded {
    border-color: rgba(39, 174, 96, 0.6);
    border-style: solid;
    background: rgba(39, 174, 96, 0.08);
}

.upload-area.uploaded i { color: #2ecc71; opacity: 1; }

.upload-preview {
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    border-radius: 10px;
    display: none;
    margin-bottom: 10px;
}

/* ===========================
   LOADING / ANALYSIS
   =========================== */
.loading-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 25px;
    text-align: center;
}

.loading-icon-ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 34px;
    position: relative;
}

.loading-icon-ring::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #fff;
    border-right-color: rgba(255, 255, 255, 0.25);
    animation: spin 1.1s linear infinite;
}

.loading-icon-ring i { font-size: 2.5rem; opacity: 0.7; }

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

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    flex-shrink: 0;
}

.loading-title {
    font-size: 1.55rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.4px;
    color: #fff;
}

.loading-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 34px;
    font-weight: 400;
}

.loading-message {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.75);
    min-height: 22px;
    transition: opacity 0.3s ease;
    font-weight: 500;
}

.loading-checks {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-top: 48px;
    width: 100%;
    max-width: 260px;
}

.loading-check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.84rem;
    font-weight: 500;
    color: #fff;
}

.loading-check-item.done   { opacity: 0.6; }
.loading-check-item.active { opacity: 1; }
.loading-check-item.pending { opacity: 0.3; }

/* ===========================
   RESULT
   =========================== */
.result-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 25px 80px;
    text-align: center;
}

.result-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2.8rem;
}

.result-icon.approved {
    background: rgba(39, 174, 96, 0.18);
    border: 2px solid rgba(39, 174, 96, 0.4);
}

.result-icon.denied {
    background: rgba(231, 76, 60, 0.15);
    border: 2px solid rgba(231, 76, 60, 0.35);
}

.result-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
    line-height: 1.15;
    color: #fff;
}

.result-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 auto 34px;
    line-height: 1.6;
    max-width: 420px;
    font-weight: 400;
    text-align: center;
    padding: 0 20px;
}

.result-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    margin-bottom: 28px;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.level-badge {
    font-size: 0.78rem;
    font-weight: 700;
    background: #27ae60;
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}

.limit-amount {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    margin-bottom: 4px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
}

.limit-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 22px;
    font-weight: 400;
}

.benefits-list { list-style: none; text-align: left; padding: 0; }

.benefits-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.86rem;
    font-weight: 500;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.85);
}

.benefits-list li:last-child { border-bottom: none; }
.benefits-list li i { color: #2ecc71; font-size: 0.95rem; flex-shrink: 0; }

.result-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===========================
   SECURITY NOTE
   =========================== */
.security-note {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 20px;
    line-height: 1.55;
    font-weight: 400;
}

.security-note i { flex-shrink: 0; margin-top: 1px; opacity: 0.6; }

/* ===========================
   ALERTS
   =========================== */
.vulon-alert {
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vulon-alert-success {
    background: rgba(39, 174, 96, 0.18);
    border: 1px solid rgba(39, 174, 96, 0.35);
    color: #a8f5c2;
}

.vulon-alert-error {
    background: rgba(231, 76, 60, 0.18);
    border: 1px solid rgba(231, 76, 60, 0.35);
    color: #ffaaaa;
}

.vulon-alert-warning {
    background: rgba(241, 196, 15, 0.18);
    border: 1px solid rgba(241, 196, 15, 0.35);
    color: #ffe08a;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 480px) {
    .auth-container     { max-width: 100%; }
    .step-footer        { max-width: 100%; }
    .step-progress-bar  { max-width: 100%; }
    .welcome-headline   { font-size: 1.8rem; }
    .welcome-logo-img   { width: 150px; }
}
