/* ================================================================
   Barangay Registration Page — rp- prefix
   Mirrors the login page design language (lp- prefix in login.css)
   ================================================================ */

/* ── Reset & root ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body.rp-body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    color: #111827;
    background: #0a1f45;
    -webkit-font-smoothing: antialiased;
}

/* Official tricolor accent bar across the very top. */
.rp-topbar {
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, #0038a8 0 42%, #fcd116 42% 58%, #ce1126 58% 100%);
    position: sticky; top: 0; z-index: 10;
}

/* ── Two-column root ────────────────────────────────────── */
.rp-root {
    display: grid;
    grid-template-columns: 420px 1fr;
    min-height: 100vh;
}

/* ════════════════════════════════════════════════════════
   LEFT — Brand Panel
   ════════════════════════════════════════════════════════ */
.rp-brand {
    position: sticky;
    top: 4px;
    height: calc(100vh - 4px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #fff;
    background: linear-gradient(165deg, #0a2350 0%, #0b2f6b 52%, #0a2350 100%);
}

/* Soft directional light — replaces the decorative circles/grid. */
.rp-brand-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(60% 40% at 82% 6%, rgba(59,130,246,0.28), transparent 60%),
        radial-gradient(50% 40% at 0% 100%, rgba(8,20,45,0.55), transparent 55%);
    pointer-events: none;
}

.rp-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 38px 38px 28px;
}

/* identity */
.rp-identity {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 8px 0 36px;
}

.rp-seal { margin-bottom: 20px; }

.rp-seal-outer {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: #fff;
    padding: 5px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.15);
    position: relative;
}
.rp-seal-outer::before {
    content: '';
    position: absolute; inset: -5px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.16);
}
.rp-seal-inner {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.rp-seal-img { width: 100%; height: 100%; object-fit: contain; padding: 5px; display: block; }

.rp-brand-name {
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 8px;
}

.rp-brand-system {
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    line-height: 1.55;
    max-width: 280px;
}

.rp-brand-location {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.82);
}
.rp-brand-location i { color: rgba(255,255,255,0.55); font-size: 12px; }

/* "How registration works" */
.rp-steps-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: 6px;
}

/* registration steps */
.rp-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}

.rp-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.rp-step:last-child { border-bottom: none; }

.rp-step-num {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(59,130,246,.18);
    border: 1.5px solid rgba(96,165,250,.5);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #93c5fd;
    margin-top: 1px;
}

.rp-step-body { display: flex; flex-direction: column; gap: 3px; }

.rp-step-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,.9);
    line-height: 1.3;
}

.rp-step-sub {
    font-size: 12px;
    color: rgba(255,255,255,.6);
    line-height: 1.5;
}

/* disclaimer */
.rp-brand-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 11.5px;
    color: rgba(255,255,255,.5);
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.08);
    line-height: 1.6;
}

.rp-brand-disclaimer i { color: rgba(255,255,255,.35); flex-shrink: 0; margin-top: 2px; }

/* ════════════════════════════════════════════════════════
   RIGHT — Form Panel
   ════════════════════════════════════════════════════════ */
.rp-form-panel {
    background: #fff;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.rp-form-wrap {
    flex: 1;
    padding: 44px 48px 32px;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
}

/* form header */
.rp-form-hd { margin-bottom: 28px; }

.rp-form-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 10px;
}

.rp-eyebrow-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #2563eb;
}

.rp-form-title {
    font-size: 26px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -.5px;
    margin-bottom: 6px;
}

.rp-form-sub {
    font-size: 13.5px;
    color: #6b7280;
    line-height: 1.5;
}

/* ── Alerts ─────────────────────────────────────────────── */
.rp-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.rp-alert i { flex-shrink: 0; margin-top: 1px; }

.rp-alert--success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
}

.rp-alert--error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.rp-alert--info {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1d4ed8;
}

.rp-alert strong { font-weight: 700; }
.rp-alert p { margin-top: 3px; font-size: 13px; }
.rp-alert a { color: inherit; font-weight: 600; }

/* ── Form ───────────────────────────────────────────────── */
.rp-form { display: flex; flex-direction: column; gap: 18px; }

.rp-field { display: flex; flex-direction: column; gap: 5px; }

.rp-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.rp-label-hint {
    font-weight: 400;
    color: #9ca3af;
    margin-left: 4px;
}

/* ── Input ──────────────────────────────────────────────── */
.rp-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.rp-input-ico {
    position: absolute;
    left: 14px;
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.rp-input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 42px;
    border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    background: #f9fafb;
    font-size: 14px;
    color: #111827;
    font-family: inherit;
    outline: none;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.rp-input:focus {
    background: #fff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3.5px rgba(37,99,235,.12);
}

.rp-input--has-action { padding-right: 44px; }

.rp-eye-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px;
    font-size: 14px;
    display: flex; align-items: center;
    transition: color .15s;
}

.rp-eye-btn:hover { color: #374151; }

/* ── Field error ────────────────────────────────────────── */
.rp-field-err {
    font-size: 12px;
    color: #ef4444;
    display: none;
}
.rp-field-err.is-shown { display: block; }

/* ── Location cascade ───────────────────────────────────── */
.rp-location-section { display: flex; flex-direction: column; gap: 14px; }

.rp-location-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.rp-location-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #f3f4f6;
}

/* ── Select ─────────────────────────────────────────────── */
.rp-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.rp-select-ico {
    position: absolute;
    left: 14px;
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.rp-select-arrow {
    position: absolute;
    right: 12px;
    color: #9ca3af;
    font-size: 11px;
    pointer-events: none;
}

.rp-select {
    width: 100%;
    height: 46px;
    padding: 0 36px 0 42px;
    border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    background: #f9fafb;
    font-size: 14px;
    color: #111827;
    font-family: inherit;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.rp-select:focus {
    background: #fff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3.5px rgba(37,99,235,.12);
}

.rp-select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.rp-select--loading { color: #9ca3af; }

/* ── Password strength ──────────────────────────────────── */
.rp-pwd-strength {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rp-strength-bars {
    display: flex;
    gap: 4px;
}

.rp-strength-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: #e5e7eb;
    transition: background .25s;
}

.rp-strength-bar.is-weak     { background: #ef4444; }
.rp-strength-bar.is-fair     { background: #f97316; }
.rp-strength-bar.is-good     { background: #eab308; }
.rp-strength-bar.is-strong   { background: #22c55e; }

.rp-strength-text {
    font-size: 11.5px;
    color: #9ca3af;
    font-weight: 500;
}

/* ── Role cards ─────────────────────────────────────────── */
.rp-role-section { display: flex; flex-direction: column; gap: 10px; }

.rp-role-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.rp-role-opt { position: relative; }

.rp-role-native {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

.rp-role-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.rp-role-native:checked + .rp-role-card {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

.rp-role-ico {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 8px;
    background: rgba(37,99,235,.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    color: #2563eb;
    transition: background .15s;
}

.rp-role-native:checked + .rp-role-card .rp-role-ico {
    background: rgba(37,99,235,.18);
}

.rp-role-body { display: flex; flex-direction: column; gap: 2px; }

.rp-role-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.rp-role-sub {
    font-size: 11.5px;
    color: #6b7280;
    line-height: 1.3;
}

/* ── Divider ─────────────────────────────────────────────── */
.rp-divider {
    height: 1px;
    background: #f3f4f6;
    margin: 4px 0;
}

/* ── Data privacy consent ───────────────────────────────── */
.rp-consent {
    margin-top: 6px;
    padding: 14px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.rp-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    cursor: pointer;
}

.rp-consent-box {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin: 2px 0 0;
    accent-color: #2563eb;
    cursor: pointer;
}

.rp-consent-text {
    font-size: 12.5px;
    line-height: 1.6;
    color: #4b5563;
}

.rp-consent .rp-field-err { margin-top: 8px; }

/* Inline links inside the consent text. Buttons, not anchors, so a click opens
   the modal without navigating and without toggling the surrounding checkbox. */
.rp-legal-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: #2563eb;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.rp-legal-link:hover { color: #1d4ed8; }

/* ── Legal document modal ───────────────────────────────── */
.rp-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.rp-modal[hidden] { display: none; }

.rp-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
}

.rp-modal-card {
    position: relative;
    width: 100%;
    max-width: 780px;
    height: min(88vh, 900px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: rpModalIn .18s ease-out;
}

@keyframes rpModalIn {
    from { opacity: 0; transform: translateY(10px) scale(.99); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .rp-modal-card { animation: none; }
}

.rp-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.rp-modal-head h3 { font-size: 15.5px; font-weight: 700; color: #111827; margin: 0; }

.rp-modal-x {
    width: 32px; height: 32px;
    border: none; border-radius: 8px;
    background: #f3f4f6; color: #6b7280;
    cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}

.rp-modal-x:hover { background: #e5e7eb; color: #111827; }

.rp-modal-frame { flex: 1; width: 100%; border: none; background: #eef2f7; }

.rp-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 20px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.rp-modal-open {
    font-size: 12.5px; font-weight: 600; color: #6b7280;
    text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}

.rp-modal-open:hover { color: #2563eb; }

.rp-modal-done {
    height: 38px; padding: 0 20px;
    border: none; border-radius: 9px;
    background: #2563eb; color: #fff;
    font-size: 13.5px; font-weight: 600; cursor: pointer;
    transition: background .15s;
}

.rp-modal-done:hover { background: #1d4ed8; }

@media (max-width: 560px) {
    .rp-modal { padding: 12px; }
    .rp-modal-card { height: 92vh; }
}

/* ── Submit ─────────────────────────────────────────────── */
.rp-submit {
    height: 50px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(37,99,235,.35);
    transition: transform .15s, box-shadow .15s, opacity .15s;
    margin-top: 4px;
}

.rp-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37,99,235,.4);
}

.rp-submit:active:not(:disabled) {
    transform: translateY(0);
}

.rp-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.rp-submit-arrow { transition: transform .15s; }
.rp-submit:hover:not(:disabled) .rp-submit-arrow { transform: translateX(3px); }

/* ── Bottom links ────────────────────────────────────────── */
.rp-links {
    margin-top: 18px;
    text-align: center;
    font-size: 13.5px;
    color: #6b7280;
}

.rp-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
    transition: color .15s;
}

.rp-link:hover { color: #1d4ed8; text-decoration: underline; }

/* ── Footer ─────────────────────────────────────────────── */
.rp-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 48px 28px;
    font-size: 11.5px;
    color: #9ca3af;
}

.rp-footer-sep { color: #d1d5db; }

.rp-footer-link {
    color: #6b7280;
    font-weight: 600;
    text-decoration: none;
    transition: color .15s;
}

.rp-footer-link:hover { color: #2563eb; text-decoration: underline; }

/* ── Success state ───────────────────────────────────────── */
.rp-success-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
}

.rp-success-card {
    text-align: center;
    max-width: 400px;
}

.rp-success-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: #f0fdf4;
    border: 2px solid #86efac;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    color: #16a34a;
    margin: 0 auto 20px;
}

.rp-success-title {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 8px;
}

.rp-success-body {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.65;
    margin-bottom: 24px;
}

.rp-success-email {
    font-weight: 700;
    color: #111827;
}

.rp-success-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 24px;
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}

.rp-success-btn:hover { background: #1d4ed8; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .rp-root { grid-template-columns: 1fr; }
    .rp-brand { display: none; }
    .rp-form-wrap { padding: 36px 24px 28px; }
}

@media (max-width: 480px) {
    .rp-role-cards { grid-template-columns: 1fr; }
    .rp-form-wrap { padding: 28px 20px 24px; }
}
