/* ══════════════════════════════════════════════════════════════
   REGISTRO CSS — MegacityEnlace
   Mobile-first, letras grandes, amigable adultos mayores
══════════════════════════════════════════════════════════════ */

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

.registro-page {
    min-height: 100vh;
    background: var(--gray-100, #f5f6fa);
    overflow-x: hidden;
}

/* ── Layout ── */
.reg-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ── Panel izquierdo (escritorio) ── */
.reg-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--primary, #00b894) 0%, var(--accent, #0984e3) 100%);
    position: relative;
    overflow: hidden;
}

.reg-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 50px 50px;
}

.reg-left-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
    width: 100%;
    max-width: 380px;
    padding: 2rem;
}

.reg-left-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    text-decoration: none;
    margin-bottom: 2rem;
}

.reg-left-logo-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: rgba(255,255,255,.2);
    display: grid; place-items: center;
    font-size: 1.3rem; color: #fff;
    flex-shrink: 0;
}

.reg-left-logo span { font-size: 1.3rem; font-weight: 800; color: #fff; }
.reg-left-logo span strong { color: rgba(255,255,255,.75); font-weight: 400; }
.reg-left h2 { font-size: 1.3rem; font-weight: 700; margin: 0 0 .5rem; }
.reg-left p  { font-size: .88rem; opacity: .85; margin: 0 0 1.75rem; line-height: 1.6; }
.reg-left-features { text-align: left; }
.reg-left-feature {
    display: flex; align-items: center; gap: .75rem;
    padding: .5rem 0; font-size: .85rem; color: rgba(255,255,255,.9);
}
.reg-left-feature i { font-size: .95rem; color: rgba(255,255,255,.7); width: 18px; flex-shrink: 0; }

/* ── Panel derecho ── */
.reg-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem 4rem;
    min-width: 0;
    overflow-y: auto;
}

.reg-form-wrap {
    width: 100%;
    max-width: 500px;
}

/* ── Stepper ── */
.reg-stepper {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.reg-stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    min-width: 0;
}

.reg-stepper-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 17px;
    left: calc(50% + 18px);
    right: calc(-50% + 18px);
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.reg-stepper-item.done::after { background: var(--primary, #00b894); }

.reg-stepper-num {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: #fff;
    display: grid; place-items: center;
    font-size: .8rem; font-weight: 700; color: #bbb;
    position: relative; z-index: 1;
    transition: all .25s;
    flex-shrink: 0;
}

.reg-stepper-item.active .reg-stepper-num {
    border-color: var(--primary, #00b894);
    background: var(--primary, #00b894);
    color: #fff;
}
.reg-stepper-item.done .reg-stepper-num {
    border-color: var(--primary, #00b894);
    background: var(--primary, #00b894);
    color: #fff;
}

.reg-stepper-label {
    font-size: .62rem;
    color: #bbb;
    margin-top: 5px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
}
.reg-stepper-item.active .reg-stepper-label { color: var(--primary, #00b894); }
.reg-stepper-item.done   .reg-stepper-label { color: var(--primary, #00b894); }

/* ── Paso panel ── */
.reg-step-panel { display: none; }
.reg-step-panel.active { display: block; animation: fadeIn .25s ease; }

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

.reg-step-title {
    font-size: 1.3rem; font-weight: 800;
    color: var(--text-primary, #1a1a2e);
    margin: 0 0 .2rem;
}
.reg-step-subtitle {
    font-size: .88rem;
    color: var(--text-secondary, #777);
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

/* ── Campos ── */
.reg-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .875rem;
}

.reg-field { margin-bottom: 1.1rem; }

.reg-label {
    display: block;
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: .35rem;
}
.reg-label .req { color: #e74c3c; margin-left: 2px; }

.reg-input,
.reg-select {
    display: block;
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary, #1a1a2e);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.4;
}

.reg-input:focus,
.reg-select:focus {
    outline: none;
    border-color: var(--primary, #00b894);
    box-shadow: 0 0 0 3px rgba(0,184,148,.12);
}

.reg-input.reg-invalid,
.reg-select.reg-invalid { border-color: #e74c3c; box-shadow: 0 0 0 3px rgba(231,76,60,.1); }
.reg-input.reg-valid,
.reg-select.reg-valid   { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.08); }

.reg-error {
    font-size: .76rem;
    color: #e74c3c;
    margin-top: 4px;
    display: block;
    min-height: 14px;
}

/* ── Fecha con máscara ── */
.reg-date-hint {
    font-size: .72rem;
    color: #aaa;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Teléfono ── */
.reg-phone-wrap { display: flex; gap: .5rem; }
.reg-phone-wrap .reg-select { flex: 0 0 105px; }
.reg-phone-wrap .reg-input  { flex: 1; min-width: 0; }

/* ── WhatsApp verification ── */
.reg-wa-verify { margin-top: .75rem; }

.reg-btn-wa {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    width: 100%; padding: .75rem 1rem;
    background: #25D366; color: #fff;
    border: none; border-radius: 10px;
    font-size: .95rem; font-weight: 600;
    cursor: pointer; transition: background .2s, opacity .2s;
}
.reg-btn-wa:hover { background: #1ebe5d; }
.reg-btn-wa:disabled { opacity: .6; cursor: not-allowed; }
.reg-btn-wa .fab { font-size: 1.1rem; }

.reg-wa-hint {
    margin-top: .5rem; font-size: .8rem; color: #888;
    display: flex; align-items: center; gap: .35rem;
}
.reg-wa-hint.success { color: #10b981; }
.reg-wa-hint.error   { color: #ef4444; }

.reg-code-block { margin-top: .75rem; }

.reg-code-wrap { display: flex; gap: .5rem; }
.reg-code-input { flex: 1; letter-spacing: .25rem; font-size: 1.1rem; text-align: center; }

.reg-btn-verify {
    padding: .65rem 1.1rem; flex-shrink: 0;
    background: var(--primary); color: #fff;
    border: none; border-radius: 10px;
    font-size: .9rem; font-weight: 600;
    cursor: pointer; transition: background .2s, opacity .2s;
}
.reg-btn-verify:hover { background: var(--primary-dark, #059669); }
.reg-btn-verify:disabled { opacity: .6; cursor: not-allowed; }

.reg-resend-wrap { display: flex; align-items: center; gap: .5rem; margin-top: .4rem; }

.reg-resend-btn {
    background: none; border: none;
    color: var(--primary); font-size: .8rem; font-weight: 500;
    cursor: pointer; padding: 0;
    display: flex; align-items: center; gap: .25rem;
}
.reg-resend-btn:hover { text-decoration: underline; }

.reg-countdown { font-size: .78rem; color: #888; }

.reg-verified-badge {
    display: flex; align-items: center; gap: .45rem;
    color: #10b981; font-size: .88rem; font-weight: 600;
    background: rgba(16,185,129,.1);
    border: 1px solid rgba(16,185,129,.3);
    border-radius: 8px; padding: .55rem .85rem;
    margin-top: .5rem;
}

/* ── Password toggle ── */
.reg-pw-wrap { position: relative; }
.reg-pw-wrap .reg-input { padding-right: 46px; }
.reg-pw-toggle {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: #aaa; cursor: pointer;
    padding: 4px; font-size: 1rem;
    line-height: 1;
}

/* ── Fortaleza contraseña ── */
.pw-strength-bar {
    display: flex; gap: 4px;
    margin: 8px 0 3px;
}
.pw-strength-seg {
    flex: 1; height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    transition: background .3s;
}
.pw-strength-label {
    font-size: .74rem; font-weight: 600;
    margin-bottom: 8px; display: block;
}
.pw-req-list {
    list-style: none; padding: 0;
    margin: 0 0 .75rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 12px;
}
.pw-req {
    font-size: .76rem; color: #bbb;
    display: flex; align-items: center; gap: 5px;
    transition: color .2s;
}
.pw-req.met { color: #10b981; }
.pw-req i   { font-size: .7rem; }
#confirmMatchMsg { font-size: .76rem; margin-top: 4px; display: block; }

/* ── Alert ── */
.reg-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: .88rem; font-weight: 600;
    margin-bottom: 1.1rem;
}
.reg-alert--error   { background: #fdf0ef; color: #c0392b; border: 1px solid #fadbd8; }
.reg-alert--success { background: #eafaf1; color: #1e8449; border: 1px solid #a9dfbf; }

/* ── Botones ── */
.reg-btn {
    display: inline-flex;
    align-items: center; justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none; border-radius: 12px;
    font-size: 1rem; font-weight: 700;
    font-family: inherit; cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.reg-btn:active { transform: scale(.97); }

.reg-btn--primary {
    background: var(--primary, #00b894);
    color: #fff; flex: 1;
}
.reg-btn--primary:hover   { filter: brightness(1.05); }
.reg-btn--primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.reg-btn--secondary {
    background: #f0f0f0;
    color: #555; flex: 0 0 auto;
    padding: 14px 18px;
}

.reg-btn-group {
    display: flex; gap: .75rem;
    margin-top: 1.5rem;
}

/* ── Footer ── */
.reg-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: .85rem; color: #888;
}
.reg-footer a { color: var(--primary, #00b894); font-weight: 700; text-decoration: none; }

.reg-mid-badge {
    display: flex; align-items: center;
    justify-content: center; gap: 8px;
    margin-top: 1rem; padding: 10px 14px;
    background: #f4f5f7; border-radius: 10px;
    font-size: .76rem; color: #888;
    flex-wrap: wrap; text-align: center;
}
.reg-mid-badge i { color: var(--primary, #00b894); }

/* ── Responsive móvil ── */
@media (max-width: 800px) {
    .reg-left  { display: none; }
    .reg-right { padding: 0; align-items: stretch; }

    .reg-form-wrap {
        max-width: 100%;
        background: #fff;
        min-height: 100vh;
        padding: 1.5rem 1.25rem 3rem;
    }

    .reg-stepper { margin-bottom: 1.5rem; }
    .reg-stepper-label { font-size: .56rem; }

    .reg-step-title    { font-size: 1.15rem; }
    .reg-step-subtitle { font-size: .83rem; }

    .reg-row { grid-template-columns: 1fr; gap: 0; }
    .pw-req-list { grid-template-columns: 1fr; }

    .reg-input,
    .reg-select { font-size: 1rem; padding: 13px 12px; }

    .reg-btn { font-size: .95rem; padding: 13px 16px; }
}

@media (max-width: 380px) {
    .reg-stepper-label { display: none; }
    .reg-form-wrap { padding: 1.25rem 1rem 3rem; }
}

/* ── Google Maps — paso 2 ── */
.reg-location-wrap {
    position: relative;
}

.reg-location-wrap .reg-input {
    padding-right: 38px;
}

.map-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
    display: none;
    line-height: 1;
}
.map-clear-btn.visible { display: block; }

#regMapContainer {
    width: 100%;
    height: 240px;
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid #ddd;
    margin-top: .75rem;
    display: none;
    position: relative;
}
#regMapContainer.visible { display: block; }
#regMap { width: 100%; height: 100%; }

#regMapStatus {
    font-size: .78rem;
    color: #555;
    margin-top: 5px;
    min-height: 18px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.reg-map-hint {
    font-size: .76rem;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
}
