/* ===== RESET & BASE ===== */
:root {
    --purple: #6836D9;
    --purple-dark: #532BB5;
    --purple-deeper: #3F1F8E;
    --purple-light: #F5F1FD;
    --purple-glow: rgba(104, 54, 217, 0.25);
    --purple-tint: #6836D92d;
    --dark: #1F2937;
    --gray3: #3C3C3B;
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --white: #FFFFFF;
    --grad-purple: linear-gradient(135deg, #6836D9 0%, #834BFF 60%, #9F75FF 100%);
    --ff: 'Source Sans 3', sans-serif;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-full: 999px;
    --shadow-md: 0 4px 14px rgba(17, 24, 39, 0.06);
    --shadow-lg: 0 12px 40px rgba(17, 24, 39, 0.08);
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--ff);
    color: var(--dark);
    background: var(--white);
    font-size: 1rem;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ===== NAV ===== */
.reg-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--purple);
    padding: 0 32px;
    height: 90PX;
    display: flex;
    align-items: center;
    justify-content: space-between;
}



.reg-nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
}

.reg-nav-center span {
    font-weight: 800;
}

.reg-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-pill {
    display: none;
    /* Se muestra desde paso 3+ */
    align-items: center;
    gap: 8px;
    background: var(--white);
    border-radius: var(--radius-full);
    padding: 6px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark);
    box-shadow: var(--shadow-md);
}

.user-pill .exit-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--gray-500);
    font-size: 0.8rem;
    font-family: var(--ff);
}

.user-pill .exit-btn:hover {
    color: var(--purple);
}

.user-pill svg {
    width: 18px;
    height: 18px;
}

/* ===== MAIN CONTAINER ===== */
.reg-main {
    padding-top: 100px;
    /* nav height */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== STEP WRAPPER ===== */
.step {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 40px auto;
    padding: 60px 48px;
    background: var(--white);
    border: 2px solid var(--purple);
    border-radius: 30px;
    animation: fadeInUp 0.4s var(--ease-out);
    position: relative;
}

.step.active {
    display: flex;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== BACK LINK ===== */
.back-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--purple);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 0.7;
}

.back-link svg {
    width: 20px;
    height: 20px;
}

/* ===== TITLES ===== */
.step-title {
    font-family: var(--ff);
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 800;
    color: var(--gray3);
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
}

.step-title .accent {
    color: var(--purple);
    font-style: normal;
}

.step-subtitle {
    font-size: 0.95rem;
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 32px;
}

/* ===== FORM ELEMENTS ===== */
.form-row {
    display: flex;
    gap: 16px;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dark);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--ff);
    color: var(--dark);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-tint);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.form-group .input-wrapper {
    position: relative;
}

.form-group .input-wrapper input {
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    display: flex;
    align-items: center;
}

.toggle-password:hover {
    color: var(--purple);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.form-group .error-text {
    font-size: 0.8rem;
    color: #dc2626;
    margin-top: 2px;
    display: none;
}

.form-group.has-error input {
    border-color: #dc2626;
}

.form-group.has-error .error-text {
    display: block;
}

/* ===== BUTTONS ===== */
.btn-primary-full {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--purple);
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--ff);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    margin-top: 8px;
}

.btn-primary-full:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--purple-glow);
}

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

.btn-primary-full:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary-full {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--gray-300);
    color: var(--dark);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--ff);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary-full:hover {
    background: var(--gray-400);
    color: var(--white);
}

.btn-secondary-full:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline-full {
    width: auto;
    padding: 12px 32px;
    border: 2px solid var(--purple);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--purple);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--ff);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline-full:hover {
    background: var(--purple);
    color: var(--white);
}

/* ===== LEGAL TEXT ===== */
.legal-text {
    font-size: 0.8rem;
    color: var(--gray-500);
    text-align: center;
    margin-top: 16px;
}

.legal-text a {
    color: var(--purple);
    text-decoration: underline;
}

/* ===== STEP 2: VERIFICATION CODE ===== */
.code-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.code-inputs input {
    width: 52px;
    height: 60px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--ff);
    color: var(--dark);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--gray-100);
}

.code-inputs input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-tint);
    background: var(--white);
}

.code-timer {
    font-size: 0.9rem;
    color: var(--gray-500);
    text-align: center;
    margin-top: 12px;
    margin-bottom: 16px;
    width: 100%;
    position: relative;
    z-index: 1;
}

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

.resend-section p {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 10px;
}

.help-text {
    font-size: 0.85rem;
    color: var(--gray-500);
    text-align: center;
    margin-top: 20px;
}

.help-text a {
    color: var(--purple);
    text-decoration: underline;
}

/* ===== STEP 3: RUC TYPE ===== */
.ruc-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.ruc-card {
    flex: 1;
    max-width: 220px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.ruc-card:hover {
    transform: translateY(-3px);
}

.ruc-card .ruc-btn {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--purple);
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--ff);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ruc-card .ruc-btn:hover {
    box-shadow: 0 4px 12px var(--purple-glow);
}

.ruc-card .ruc-example {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 8px;
}

.ruc-card .ruc-desc {
    font-size: 0.82rem;
    color: var(--gray-400);
}

.ruc-no-ruc {
    text-align: center;
}

.ruc-no-ruc button {
    padding: 12px 40px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--dark);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--ff);
    cursor: pointer;
    transition: all 0.2s;
}

.ruc-no-ruc button:hover {
    border-color: var(--purple);
    color: var(--purple);
}

/* ===== STEP 5: SUCCESS ===== */
.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--purple-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: var(--purple);
}

.system-card {
    width: 100%;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.system-card-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    margin-bottom: 10px;
}

.system-card-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.system-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--purple-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.system-avatar svg {
    width: 22px;
    height: 22px;
    color: var(--purple);
}

.system-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 2px;
}

.system-info p {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.credentials-card {
    width: 100%;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.cred-block {
    flex: 1;
}

.cred-block label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    margin-bottom: 4px;
    display: block;
}

.cred-block .cred-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
    word-break: break-all;
}

.info-message {
    width: 100%;
    margin-bottom: 24px;
}

.info-message h4 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.info-message p {
    font-size: 0.85rem;
    color: var(--gray-500);
    line-height: 1.6;
}

.success-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-success-primary {
    padding: 14px 32px;
    border: 2px solid var(--purple);
    border-radius: var(--radius-full);
    background: var(--purple);
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--ff);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.btn-success-primary:hover {
    background: var(--purple-dark);
    border-color: var(--purple-dark);
}

.btn-success-secondary {
    padding: 14px 32px;
    border: 2px solid var(--purple);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--purple);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--ff);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.btn-success-secondary:hover {
    background: var(--purple);
    color: var(--white);
}

/* ===== LOADING SPINNER ===== */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

/* ===== ALERT ===== */
.alert {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 16px;
    display: none;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .reg-nav {
        padding: 0 16px;
    }

    .reg-nav-center {
        display: none;
    }

    .step {
        padding: 40px 16px 32px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .code-inputs input {
        width: 44px;
        height: 52px;
        font-size: 1.2rem;
    }

    .ruc-options {
        flex-direction: column;
        align-items: center;
    }

    .ruc-card {
        max-width: 100%;
    }

    .credentials-card {
        flex-direction: column;
        gap: 12px;
    }

    .success-actions {
        flex-direction: column;
    }

    .success-actions a,
    .success-actions button {
        width: 100%;
        text-align: center;
    }

    .user-pill {
        padding: 4px 12px;
        font-size: 0.8rem;
    }
}

/* ===== TOASTS (mismo estilo que app.css) ===== */
.toast-stack {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    min-width: 320px;
    max-width: 550px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .15);
    border: none;
    font-family: var(--ff);
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    animation: toast-in .28s cubic-bezier(.2, .8, .3, 1);
}

.toast.leaving {
    animation: toast-out .22s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(-6px) scale(.98);
    }
}

.toast .t-ic {
    flex: none;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 4px;
}

.toast .t-body {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.toast .t-title {
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.005em;
}

.toast .t-msg {
    margin-top: 2px;
    color: rgba(255, 255, 255, .85);
    line-height: 1.45;
}

.toast .t-close {
    flex: none;
    border: 0;
    background: transparent;
    color: #fff;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.toast .t-close:hover {
    opacity: 1;
}

.toast.success {
    background: #16a34a;
}

.toast.error {
    background: #dc2626;
}

.toast.info {
    background: #2563eb;
}

/* -- CTAs Paso 5 -- */
.actions-row {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 20px;
}

.cta-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 270px;
    position: relative;
    padding-top: 14px;
}

.cta-badge {
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.2px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    white-space: nowrap;
}

.cta-badge.gray {
    background: #e5e7eb;
    color: var(--gray-500);
}

.cta-badge.purple {
    background: #fff;
    color: var(--purple);
    border: 1.5px solid var(--purple);
    box-shadow: 0 2px 8px rgba(104, 54, 217, 0.2);
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
    }

    50% {
        transform: translateX(-50%) scale(1.05);
    }
}

.cta-card {
    border-radius: 12px;
    padding: 22px 24px 18px;
    text-align: center;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cta-card-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.cta-card-hint {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 14px;
    line-height: 1.4;
}

.cta-card-btn {
    display: block;
    width: 100%;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    letter-spacing: 0.3px;
    margin-top: auto;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s, transform 0.1s;
}

.cta-card.demo {
    background: #fff;
    border: 1.5px solid var(--gray-300);
}

.cta-card.demo .cta-card-title {
    color: var(--gray-500);
}

.cta-card.demo .cta-card-hint {
    color: var(--gray-400);
}

.cta-card.demo .cta-card-btn {
    background: #fff;
    color: var(--gray-500);
    border: 1.5px solid var(--gray-300);
}

.cta-card.demo .cta-card-btn:hover {
    background: #f3f4f6;
    border-color: var(--gray-400);
}

.cta-card.pago {
    background: var(--purple);
    border: 2px solid var(--purple);
    box-shadow: 0 8px 30px rgba(104, 54, 217, 0.35);
}

.cta-card.pago .cta-card-title {
    color: #fff;
}

.cta-card.pago .cta-card-hint {
    color: rgba(255, 255, 255, 0.7);
}

.cta-card.pago .cta-card-btn {
    background: #fff;
    color: var(--purple);
    border: 1.5px solid var(--purple);
    font-weight: 800;
}

.cta-card.pago .cta-card-btn:hover {
    background: #f3f4f6;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.cta-prices {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
}

.cta-price-old {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: line-through;
}

.cta-price-new {
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1;
}

.cta-price-period {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 540px) {
    .actions-row {
        flex-direction: column-reverse;
        align-items: center;
        gap: 16px;
    }

    .cta-wrap {
        max-width: 100%;
        width: 100%;
    }
}


/* ===== Scrollbar Global ===== */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background-color: var(--purple);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--purple-dark);
}