:root {
    --bg: #0d0d0d;
    --surface: rgba(38, 38, 38, 0.94);
    --surface-soft: rgba(26, 26, 26, 0.88);
    --line: rgba(255, 255, 255, 0.11);
    --text: #ededed;
    --muted: #b5b5b5;
    --white: #ffffff;
    --orange: #ff6b2b;
    --orange-2: #ff8050;
    --orange-glow: rgba(255, 107, 43, 0.28);
    --danger: #ff8585;
    --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    --radius: 28px;
    --radius-sm: 16px;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.62);
    --page-width: 376px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text);
    background:
        linear-gradient(rgba(10, 10, 10, 0.85), rgba(5, 5, 5, 0.95)),
        url("/public-site/assets/hero-johannesburg.webp") center/cover fixed;
}

.modal-open {
    overflow: hidden;
}

.portal-page {
    padding: 22px 16px 28px;
}

.portal-frame {
    width: min(100%, var(--page-width));
    margin: 0 auto;
    display: grid;
    gap: 16px;
}

.portal-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    padding: 18px 16px;
}

.portal-brand-panel,
.portal-brand-copy,
.plans-head,
.portal-card-head,
.verify-actions,
.mini-brand-lockup {
    display: grid;
    gap: 6px;
}

.portal-brand-panel {
    justify-items: center;
    text-align: center;
    padding-top: 6px;
}

.portal-brand-logo {
    width: 84px;
    height: 84px;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(255, 107, 43, 0.34);
}

.portal-brand-name,
.mini-brand-title,
.eyebrow {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--white);
}

.portal-brand-tagline,
.mini-brand-subtitle,
.portal-card-head p,
.register-intro,
.verify-hero p,
.verify-actions p,
.plan-subtitle,
.status-banner,
.timer-copy,
.portal-footnote {
    margin: 0;
    color: var(--muted);
    line-height: 1.4;
}

.portal-card-head {
    margin-bottom: 12px;
}

.portal-card-head p.promo-text {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--orange) !important;
}

.portal-card-head h1,
.plans-head h2,
.verify-hero h1 {
    margin: 0;
    font-family: var(--font-display);
    color: var(--white);
    text-transform: uppercase;
    line-height: 0.95;
    letter-spacing: 0.01em;
}

.portal-card-head h1,
.verify-hero h1 {
    font-size: clamp(2rem, 8vw, 2.5rem);
}

.plans-head h2 {
    font-size: 1.7rem;
}

.phone-input-wrap,
.form-field input,
.otp-digit {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.phone-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 14px;
    padding: 0 14px;
    min-height: 50px;
}

.country-tag {
    color: #9f9f9f;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.phone-prefix {
    color: #8f8f8f;
    font-size: 0.98rem;
}

.phone-input-wrap input,
.form-field input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--white);
    font: inherit;
}

.primary-button,
.ghost-button,
.text-button {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.primary-button {
    width: 100%;
    min-height: 48px;
    border-radius: 16px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: var(--white);
    font-weight: 900;
    box-shadow: 0 14px 30px var(--orange-glow);
}

.ghost-button {
    min-height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.compact-ghost {
    width: 100%;
    margin-top: 12px;
}

.text-button {
    padding: 0;
    background: none;
    color: var(--orange);
    font-weight: 800;
}

.plans-list {
    display: grid;
    gap: 10px;
}

.plan-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--surface-soft);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.plan-copy {
    display: grid;
    gap: 3px;
}

.plan-tag {
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 107, 43, 0.14);
    color: var(--orange);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.plan-name,
.plan-price,
.verify-phone-display {
    color: var(--white);
    font-weight: 800;
}

.plan-price,
.accent-copy,
.eyebrow {
    color: var(--orange);
}

.portal-footnote {
    text-align: center;
    margin-top: 14px;
}

.plans-note {
    margin: 6px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.status-banner {
    min-height: 1.3em;
    margin: 12px 0 10px;
    font-size: 0.92rem;
}

.status-banner.error {
    color: var(--danger);
}

.hidden {
    display: none !important;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

.page-back-link {
    color: var(--white);
    text-decoration: none;
    font-size: 1.5rem;
    line-height: 1;
    width: fit-content;
}

.verify-hero {
    padding: 14px 0 2px;
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 8px;
}

.verify-icon-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 107, 43, 0.22);
}

.verify-icon {
    font-size: 2rem;
}

.verify-phone-display {
    font-size: 1.05rem;
}

.otp-grid {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}

.otp-digit {
    width: 46px;
    height: 54px;
    border-radius: 12px;
    text-align: center;
    font-size: 1.9rem;
    font-family: var(--font-body);
    outline: none;
}

.otp-digit:focus,
.phone-input-wrap:focus-within,
.form-field input:focus {
    border-color: rgba(255, 107, 43, 0.65);
    box-shadow: 0 0 0 3px rgba(255, 107, 43, 0.18);
}

.verify-actions {
    justify-items: center;
    margin-top: 16px;
}

.otp-status-banner {
    margin-top: 0;
    margin-bottom: 12px;
    text-align: center;
}

.inline-register-section {
    display: grid;
    gap: 10px;
    margin: 8px 0 2px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(12, 12, 12, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.inline-register-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--white);
}

.inline-terms-row {
    margin-top: 2px;
}

.register-brand-row {
    padding-top: 6px;
}

.register-header {
    display: grid;
    gap: 8px;
    justify-items: center;
    text-align: center;
    padding-top: 6px;
}

.register-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.register-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2rem, 8vw, 2.5rem);
    line-height: 0.96;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    color: var(--white);
}

.mini-brand-lockup {
    grid-auto-flow: column;
    justify-content: start;
    align-items: center;
    gap: 10px;
}

.mini-brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
}

.register-intro {
    padding: 2px 8px 0;
    font-size: 0.95rem;
    text-align: center;
}

.register-card form {
    display: grid;
    gap: 12px;
}

.register-card {
    padding: 18px;
}

.standard-field {
    padding: 10px;
    border-radius: 14px;
    background: rgba(12, 12, 12, 0.44);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.form-field {
    display: grid;
    gap: 8px;
}

.field-label {
    color: #d2d2d2;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.form-field input {
    min-height: 44px;
    border-radius: 12px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.terms-row {
    display: flex;
    align-items: start;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.45;
}

.terms-link {
    color: var(--orange);
    font-weight: 700;
}

.terms-row input {
    margin-top: 2px;
}

.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
}

.legal-modal-dialog {
    position: relative;
    width: min(100%, 960px);
    max-height: min(90vh, 880px);
    display: grid;
    gap: 16px;
    padding: 20px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(14, 14, 14, 0.97);
    box-shadow: var(--shadow);
}

.legal-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    font-size: 1.4rem;
    cursor: pointer;
}

.legal-modal-head,
.legal-modal-actions {
    display: grid;
    gap: 6px;
}

.legal-modal-head h2,
.legal-doc-panel h3 {
    margin: 0;
    color: var(--white);
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.legal-modal-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
    max-width: 56ch;
}

.legal-doc-stack {
    display: grid;
    gap: 14px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.legal-doc-panel {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-doc-content {
    max-height: min(30vh, 320px);
    overflow-y: auto;
    padding: 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--muted);
    line-height: 1.7;
}

.legal-doc-content h1,
.legal-doc-content h2,
.legal-doc-content h3 {
    margin-top: 0;
    color: var(--white);
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.legal-doc-content p,
.legal-doc-content li {
    color: var(--muted);
}

.legal-doc-content a {
    color: var(--orange);
}

.legal-modal-actions {
    justify-items: end;
}

.legal-modal-actions .primary-button {
    width: auto;
    min-width: 220px;
}

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

@media (min-width: 700px) {
    .portal-page {
        padding-top: 32px;
    }
}

@media (max-width: 760px) {
    .legal-modal {
        padding: 10px;
    }

    .legal-modal-dialog {
        max-height: 94vh;
        padding: 16px;
    }

    .legal-doc-content {
        max-height: 24vh;
    }

    .legal-modal-actions {
        justify-items: stretch;
    }

    .legal-modal-actions .primary-button {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 420px) {
    .portal-page {
        padding: 16px 12px 22px;
    }

    .portal-frame {
        gap: 12px;
    }

    .portal-card {
        padding: 16px 14px;
        border-radius: 22px;
    }

    .verify-hero {
        padding-top: 6px;
        gap: 6px;
    }

    .verify-icon-wrap {
        width: 64px;
        height: 64px;
    }

    .verify-icon {
        font-size: 1.5rem;
    }

    .verify-hero h1 {
        font-size: clamp(1.6rem, 8vw, 2rem);
    }

    .verify-phone-display {
        font-size: 0.98rem;
    }

    .otp-grid {
        gap: 8px;
        margin-bottom: 12px;
    }

    .otp-digit {
        width: 41px;
        height: 48px;
        font-size: 1.55rem;
    }

    .inline-register-section {
        padding: 10px;
    }
}

@media (max-width: 360px) {
    .portal-page {
        padding-inline: 10px;
    }

    .portal-card {
        padding: 14px 12px;
    }

    .otp-grid {
        gap: 6px;
    }

    .otp-digit {
        width: 36px;
        height: 44px;
        font-size: 1.35rem;
        border-radius: 10px;
    }

    .verify-actions {
        margin-top: 12px;
    }
}
