/* ============================================================
 * Modulo Registro publico — sistema de diseno
 *
 * Layout split-screen (aside branding + main wizard) con 3 pasos.
 * Tokens propios para evitar herencia de la pagina de login.
 * ============================================================ */

:root {
    --reg-bg:            #eef2f9;
    --reg-surface:       #ffffff;
    --reg-surface-alt:   #f6f8fc;
    --reg-border:        #e3e8f1;
    --reg-border-strong: #cbd4e2;
    --reg-text:          #1a2540;
    --reg-text-soft:     #66738f;
    --reg-text-mute:     #8d97ad;
    --reg-primary:       #4f6fff;
    --reg-primary-dark:  #3553e5;
    --reg-primary-soft:  #eaf0ff;
    --reg-success:       #16a34a;
    --reg-success-soft:  #dcfce7;
    --reg-danger:        #dc2626;
    --reg-danger-soft:   #fee2e2;
    --reg-warning:       #d97706;
    --reg-warning-soft:  #fef3c7;
    --reg-radius:        14px;
    --reg-radius-sm:     8px;
    --reg-shadow-sm:     0 1px 2px rgba(20, 32, 70, .04);
    --reg-shadow-md:     0 8px 30px rgba(20, 32, 70, .08);
    --reg-shadow-lg:     0 20px 60px rgba(20, 32, 70, .12);
    --reg-trans:         .25s cubic-bezier(.4, 0, .2, 1);
}

/* ----- override del body para esta pagina ----- */
body.reg-page {
    background:
        radial-gradient(at 20% 0%, #dde6ff 0, transparent 50%),
        radial-gradient(at 90% 90%, #e6dcff 0, transparent 45%),
        var(--reg-bg) !important;
    min-height: 100vh;
}
body.reg-page .main-content { background: transparent; }

/* ============================================================
 * Layout split
 * ============================================================ */
.reg-shell {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
    gap: 24px;
    align-items: stretch;
}

@media (max-width: 991px) {
    .reg-shell {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }
}

/* ============================================================
 * Aside: branding + valor
 * ============================================================ */
.reg-aside {
    background: linear-gradient(135deg, #1a2540 0%, #2c3a6b 50%, #4f6fff 100%);
    border-radius: var(--reg-radius);
    padding: 40px 36px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    box-shadow: var(--reg-shadow-md);
}
.reg-aside::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
}
.reg-aside::after {
    content: "";
    position: absolute;
    bottom: -120px;
    left: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .04);
}
.reg-aside > * { position: relative; z-index: 1; }

.reg-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 36px;
}
.reg-brand-name {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -.3px;
    text-align: center;
    line-height: 1.1;
}

.reg-pitch h1 {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 14px;
    letter-spacing: -.5px;
    color: #ffffff;
}
.reg-pitch .lead {
    font-size: 15px;
    line-height: 1.6;
    opacity: .9;
    margin: 0 0 28px;
    color: #ffffff;
}

.reg-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
}
.reg-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    line-height: 1.4;
}
.reg-benefits li i {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, .15);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.reg-benefits li b { font-weight: 600; }
.reg-benefits li small { display: block; opacity: .7; font-size: 12px; margin-top: 2px; }

.reg-foot { font-size: 12px; opacity: .75; line-height: 1.5; color: #fff; }
.reg-foot-link {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity var(--reg-trans);
}
.reg-foot-link:hover { color: #fff; opacity: .85; text-decoration: underline; }

@media (max-width: 991px) {
    .reg-aside { padding: 28px 24px; }
    .reg-pitch h1 { font-size: 22px; }
    .reg-pitch .lead, .reg-benefits { display: none; }
    .reg-brand { margin-bottom: 0; }
    .reg-foot { display: none; }
}

/* ============================================================
 * Main: wizard
 * ============================================================ */
.reg-main {
    display: flex;
    align-items: center;
    justify-content: center;
}
.reg-card {
    background: var(--reg-surface);
    border-radius: var(--reg-radius);
    box-shadow: var(--reg-shadow-lg);
    width: 100%;
    max-width: 560px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.reg-card-head {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.reg-back {
    color: var(--reg-text-soft);
    text-decoration: none;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    transition: color var(--reg-trans);
}
.reg-back:hover { color: var(--reg-primary); text-decoration: none; }

.reg-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--reg-text);
    margin: 0;
    letter-spacing: -.3px;
}
.reg-subtitle {
    font-size: 13px;
    color: var(--reg-text-soft);
    margin: 4px 0 0;
}

/* ----- stepper ----- */
.reg-stepper {
    display: flex;
    align-items: center;
    gap: 0;
}
.reg-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}
.reg-step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--reg-border-strong);
    color: var(--reg-text-mute);
    background: var(--reg-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    transition: all var(--reg-trans);
}
.reg-step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--reg-text-mute);
    transition: color var(--reg-trans);
    line-height: 1.2;
}
.reg-step-line {
    flex: 1;
    height: 2px;
    background: var(--reg-border-strong);
    margin: 0 6px;
    transition: background var(--reg-trans);
}
.reg-step.is-active .reg-step-num {
    border-color: var(--reg-primary);
    background: var(--reg-primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--reg-primary-soft);
}
.reg-step.is-active .reg-step-label { color: var(--reg-text); font-weight: 600; }
.reg-step.is-done .reg-step-num {
    border-color: var(--reg-primary);
    background: var(--reg-primary);
    color: #fff;
}
.reg-step.is-done .reg-step-num::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 12px;
}
.reg-step.is-done .reg-step-num span { display: none; }
.reg-step.is-done + .reg-step .reg-step-line,
.reg-step.is-done .reg-step-line { background: var(--reg-primary); }

@media (max-width: 575px) {
    .reg-step-label { display: none; }
}

/* ============================================================
 * Form
 * ============================================================ */
.reg-form { display: flex; flex-direction: column; gap: 20px; }
.reg-step-pane { display: none; flex-direction: column; gap: 16px; }
.reg-step-pane.is-active { display: flex; animation: regFade .35s ease; }

@keyframes regFade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.reg-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.reg-row-2 { grid-template-columns: repeat(2, 1fr); }
.reg-row-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 575px) {
    .reg-row-2, .reg-row-3 { grid-template-columns: 1fr; }
}

.reg-field { display: flex; flex-direction: column; gap: 6px; }
.reg-field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--reg-text);
    letter-spacing: .2px;
}
.reg-field-label .req { color: var(--reg-danger); margin-left: 2px; }
.reg-field-help {
    font-size: 11px;
    color: var(--reg-text-mute);
    margin-top: 2px;
    transition: color var(--reg-trans);
}
.reg-field-help.is-ok    { color: var(--reg-success); font-weight: 500; }
.reg-field-help.is-error { color: var(--reg-danger);  font-weight: 500; }

.reg-input,
.reg-select {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    background: var(--reg-surface);
    border: 1.5px solid var(--reg-border);
    border-radius: var(--reg-radius-sm);
    color: var(--reg-text);
    font-size: 14px;
    transition: border-color var(--reg-trans), box-shadow var(--reg-trans);
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none !important;
}
.reg-input::placeholder { color: var(--reg-text-mute); }
.reg-input:focus,
.reg-select:focus {
    outline: none;
    border-color: var(--reg-primary);
    box-shadow: 0 0 0 4px var(--reg-primary-soft) !important;
}
.reg-input.is-invalid,
.reg-select.is-invalid {
    border-color: var(--reg-danger) !important;
    box-shadow: 0 0 0 4px var(--reg-danger-soft) !important;
}

.reg-select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

.reg-textarea {
    min-height: 78px;
    padding: 10px 14px;
    resize: vertical;
}

/* ----- input con boton (RNC validador) ----- */
.reg-input-group {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--reg-border);
    border-radius: var(--reg-radius-sm);
    background: var(--reg-surface);
    transition: border-color var(--reg-trans), box-shadow var(--reg-trans);
    overflow: hidden;
}
.reg-input-group:focus-within {
    border-color: var(--reg-primary);
    box-shadow: 0 0 0 4px var(--reg-primary-soft);
}
.reg-input-group.is-invalid {
    border-color: var(--reg-danger);
    box-shadow: 0 0 0 4px var(--reg-danger-soft);
}
.reg-input-group .reg-input {
    border: none;
    box-shadow: none !important;
    border-radius: 0;
}
.reg-input-group .reg-input:focus { box-shadow: none !important; }
.reg-input-group-btn {
    border: none;
    background: var(--reg-surface-alt);
    color: var(--reg-text-soft);
    padding: 0 16px;
    font-size: 14px;
    cursor: pointer;
    border-left: 1px solid var(--reg-border);
    transition: background var(--reg-trans), color var(--reg-trans);
}
.reg-input-group-btn:hover { background: var(--reg-primary); color: #fff; }
.reg-input-group-btn:disabled { background: var(--reg-surface-alt); color: var(--reg-text-mute); cursor: wait; }

/* ----- terminos ----- */
.reg-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--reg-surface-alt);
    border: 1px solid var(--reg-border);
    border-radius: var(--reg-radius-sm);
    cursor: pointer;
    transition: background var(--reg-trans), border-color var(--reg-trans);
}
.reg-check:hover { background: #eef2f9; }
.reg-check input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: var(--reg-primary);
    cursor: pointer;
}
.reg-check label { font-size: 13px; color: var(--reg-text); margin: 0; cursor: pointer; line-height: 1.4; }
.reg-check label a { color: var(--reg-primary); text-decoration: none; font-weight: 500; }

/* ----- alertas inline ----- */
.reg-alert {
    padding: 10px 14px;
    border-radius: var(--reg-radius-sm);
    font-size: 13px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
}
.reg-alert i { flex-shrink: 0; margin-top: 2px; }
.reg-alert-info    { background: var(--reg-primary-soft); color: var(--reg-primary-dark); border: 1px solid #c7d4ff; }
.reg-alert-success { background: var(--reg-success-soft); color: #166534; border: 1px solid #bbf7d0; }
.reg-alert-warning { background: var(--reg-warning-soft); color: #92400e; border: 1px solid #fde68a; }
.reg-alert-danger  { background: var(--reg-danger-soft);  color: #991b1b; border: 1px solid #fecaca; }

/* ============================================================
 * Footer del wizard
 * ============================================================ */
.reg-card-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--reg-border);
}
.reg-btn {
    height: 44px;
    padding: 0 22px;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--reg-radius-sm);
    border: 1.5px solid transparent;
    background: var(--reg-surface);
    color: var(--reg-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--reg-trans);
    text-decoration: none;
    line-height: 1;
}
.reg-btn:hover { text-decoration: none; }
.reg-btn:disabled { opacity: .55; cursor: not-allowed; }
.reg-btn-primary {
    background: var(--reg-primary);
    color: #fff;
    border-color: var(--reg-primary);
    box-shadow: 0 4px 14px rgba(79, 111, 255, .35);
}
.reg-btn-primary:hover:not(:disabled) {
    background: var(--reg-primary-dark);
    border-color: var(--reg-primary-dark);
    color: #fff;
    box-shadow: 0 6px 22px rgba(79, 111, 255, .45);
    transform: translateY(-1px);
}
.reg-btn-ghost {
    background: var(--reg-surface);
    color: var(--reg-text-soft);
    border-color: var(--reg-border-strong);
}
.reg-btn-ghost:hover:not(:disabled) {
    background: var(--reg-surface-alt);
    color: var(--reg-text);
    border-color: var(--reg-text-mute);
}
.reg-btn-link {
    background: transparent;
    border: none;
    color: var(--reg-primary);
    padding: 0 4px;
    height: auto;
}
