/* ═══════════════════════════════════════════════════════════════
   Register — layout terpisah (biru modern, scroll aman)
   ═══════════════════════════════════════════════════════════════ */

html:has(.reg-body) {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
}

.reg-body {
    --reg-primary: #2563eb;
    --reg-primary-dark: #1d4ed8;
    --reg-primary-soft: rgba(37, 99, 235, 0.14);
    --reg-hero-from: #1e40af;
    --reg-hero-mid: #2563eb;
    --reg-hero-to: #4f46e5;
    --reg-text: #0f172a;
    --reg-muted: #64748b;
    --reg-border: #e2e8f0;
    --reg-input-bg: #f3f4f6;

    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--reg-hero-from);
    color: var(--reg-text);
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
}

.reg-page {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 100dvh;
    box-sizing: border-box;
}

.reg-shell {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    box-sizing: border-box;
}

/* ── Hero / aside ── */
.reg-aside {
    display: block;
}

.reg-hero {
    position: relative;
    background: linear-gradient(155deg, var(--reg-hero-from) 0%, var(--reg-hero-mid) 48%, var(--reg-hero-to) 100%);
    overflow: hidden;
    padding-top: max(env(safe-area-inset-top), 8px);
}

.reg-hero__blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.reg-blob {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.reg-blob--1 {
    width: 140px;
    height: 140px;
    top: -30px;
    right: -20px;
}

.reg-blob--2 {
    width: 100px;
    height: 100px;
    bottom: 8%;
    left: -25px;
}

.reg-blob--3 {
    width: 70px;
    height: 70px;
    top: 38%;
    right: 12%;
}

.reg-hero__top {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    padding: 8px 20px 0;
}

.reg-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}

.reg-hero__inner {
    position: relative;
    z-index: 2;
    padding: 8px 24px 28px;
    text-align: center;
}

.reg-brand__logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.reg-brand__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reg-brand__logo i {
    font-size: 1.75rem;
    color: #fff;
}

.reg-brand__title {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.reg-brand__sub {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

.reg-aside .auth-register-info-mobile {
    display: none;
}

.reg-aside .auth-register-info-panel {
    display: none;
}

/* ── Form column — lengkungan atas (transisi biru → putih) ── */
.reg-main {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 100%;
    margin-top: -24px;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    border-radius: 28px 28px 0 0;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 -6px 32px rgba(15, 23, 42, 0.1);
    box-sizing: border-box;
}

.reg-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    padding: 24px 20px max(28px, env(safe-area-inset-bottom));
    overflow: visible;
    box-sizing: border-box;
}

.reg-card .auth-form,
.reg-card .auth-page-head {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.reg-card .auth-field {
    width: 100%;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.reg-card .auth-field-row {
    width: 100%;
    box-sizing: border-box;
}

.reg-card .auth-input-wrap {
    display: block;
    width: 100%;
}

.reg-card .auth-submit-bar {
    position: static;
    margin: 20px 0 0;
    padding: 0;
    width: 100%;
    background: none;
    box-sizing: border-box;
}

.reg-card {
    --auth-primary: var(--reg-primary);
    --auth-primary-dark: var(--reg-primary-dark);
    --auth-primary-soft: var(--reg-primary-soft);
}

.reg-card .auth-page-head {
    margin-bottom: 22px;
}

.reg-card .auth-page-accent {
    display: none;
}

.reg-card .auth-page-desc {
    display: none;
}

.reg-card .auth-page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.02em;
}

.reg-card .auth-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}

.reg-card .auth-input--plain,
.reg-card .auth-input,
.reg-card select.auth-input {
    background: var(--reg-input-bg);
    border: 1.5px solid #d1d5db;
    border-radius: 12px;
}

.reg-card .auth-input--plain:focus,
.reg-card .auth-input:focus,
.reg-card select.auth-input:focus {
    background: #fff;
    border-color: var(--reg-primary);
    box-shadow: 0 0 0 3px var(--reg-primary-soft);
    outline: none;
}

.reg-card .auth-section-title::before,
.reg-card .auth-section-title::after {
    background: #d1d5db;
}

.reg-card .auth-divider::before,
.reg-card .auth-divider::after {
    background: #e5e7eb;
}

.reg-card .auth-submit {
    background: var(--reg-primary);
    border-radius: 12px;
    min-height: 52px;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.28);
}

.reg-card .auth-npsn-box {
    border-radius: 12px;
}

.reg-card .auth-npsn-box .auth-input--plain {
    border-radius: 10px;
}

.reg-card .auth-alert,
.reg-card .auth-trial-banner,
.reg-card .auth-paket-card,
.reg-card .auth-paket-footnote {
    border-radius: 12px;
}

/* Paket — grid & state terpilih (register) */
.reg-card .auth-paket-grid {
    column-gap: 12px;
    row-gap: 16px;
    padding-top: 12px;
    align-items: stretch;
}

.reg-card .auth-paket-label {
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
    min-width: 0;
}

.reg-card .auth-paket-card {
    border: 2px solid #d1d5db;
    background: #f9fafb;
    box-shadow: none;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    box-sizing: border-box;
}

.reg-card .auth-paket-label.is-selected .auth-paket-card,
.reg-card .auth-paket-label:has(input:checked) .auth-paket-card,
.reg-card .auth-paket-label input:checked + .auth-paket-card {
    border-color: var(--reg-primary);
    border-width: 2px;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
    outline: 3px solid var(--reg-primary-soft);
    outline-offset: 0;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.14);
}

.reg-card .auth-paket-label.is-selected .auth-paket-name,
.reg-card .auth-paket-label:has(input:checked) .auth-paket-name,
.reg-card .auth-paket-label input:checked + .auth-paket-card .auth-paket-name {
    color: var(--reg-primary-dark);
}

.reg-card .auth-paket-label.is-selected .auth-paket-card::after,
.reg-card .auth-paket-label:has(input:checked) .auth-paket-card::after,
.reg-card .auth-paket-label input:checked + .auth-paket-card::after {
    content: '✓';
    font-family: inherit;
    font-weight: 800;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--reg-primary);
    color: #fff;
    font-size: 0.65rem;
    line-height: 22px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

.reg-card .auth-paket-grid:has(.is-selected) .auth-paket-label:not(.is-selected) .auth-paket-card,
.reg-card .auth-paket-grid:has(input:checked) .auth-paket-label:not(:has(input:checked)) .auth-paket-card {
    opacity: 0.72;
}

.reg-card .auth-submit:hover {
    background: var(--reg-primary-dark);
}

.reg-card .auth-footer a {
    color: var(--reg-primary);
}

.reg-card .auth-npsn-box {
    border-color: #c7d2fe;
    background: #eef2ff;
}

.reg-card #npsn {
    scroll-margin-top: 20px;
}

/* Tablet: kartu di tengah */
@media (min-width: 640px) and (max-width: 991.98px) {
    .reg-body {
        background: linear-gradient(165deg, #0f172a 0%, #1e3a5f 55%, #312e81 100%);
    }

    .reg-page {
        max-width: 520px;
        margin: 0 auto;
        padding: 24px 16px 32px;
        box-sizing: border-box;
    }

    .reg-shell {
        border-radius: 32px;
        overflow: visible;
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.1),
            0 32px 64px rgba(0, 0, 0, 0.4);
    }

    .reg-hero {
        background: linear-gradient(155deg, var(--reg-hero-from) 0%, var(--reg-hero-mid) 48%, var(--reg-hero-to) 100%);
    }
}

/* ═══ Desktop: 2 kolom, scroll di kolom form ═══ */
@media (min-width: 992px) {
    html:has(.reg-body) {
        height: 100%;
        overflow: hidden;
    }

    .reg-body {
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
        background: linear-gradient(165deg, #0f172a 0%, #1e3a5f 50%, #312e81 100%);
    }

    .reg-page {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        min-height: 0;
        max-width: none;
        margin: 0;
        padding: 20px 24px;
        box-sizing: border-box;
    }

    .reg-shell {
        display: grid;
        grid-template-columns: minmax(300px, 1fr) minmax(400px, 1.12fr);
        grid-template-rows: minmax(0, 1fr);
        align-items: stretch;
        width: 100%;
        max-width: 1080px;
        height: 100%;
        max-height: min(900px, calc(100dvh - 40px));
        min-height: 0;
        border-radius: 24px;
        overflow: hidden;
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.08),
            0 28px 72px rgba(0, 0, 0, 0.4);
        background: #f1f5f9;
    }

    .reg-aside {
        min-height: 0;
        min-width: 0;
        height: 100%;
        overflow: hidden;
    }

    .reg-hero {
        height: 100%;
        min-height: 0;
        display: flex;
        flex-direction: column;
        background: linear-gradient(160deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    }

    .reg-hero__top {
        justify-content: flex-start;
        flex-shrink: 0;
    }

    .reg-hero__inner {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        text-align: left;
        padding: 4px 24px 24px;
        -webkit-overflow-scrolling: touch;
    }

    .reg-brand__logo {
        margin: 0 0 14px;
    }

    .reg-brand__title,
    .reg-brand__sub {
        text-align: left;
    }

    .reg-aside .auth-register-info-mobile {
        display: none !important;
    }

    .reg-aside .auth-register-info-panel {
        display: block !important;
    }

    .reg-main {
        margin-top: 0;
        min-height: 0;
        min-width: 0;
        height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 14px 16px;
        box-sizing: border-box;
    }

    .reg-main::-webkit-scrollbar {
        width: 7px;
    }

    .reg-main::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 99px;
    }

    .reg-card {
        margin: 0;
        border-radius: 16px;
        box-shadow: 0 2px 20px rgba(15, 23, 42, 0.07);
        padding: 24px 22px 28px;
    }

    .reg-card .auth-page-accent {
        display: block;
    }

    .reg-card .auth-page-desc {
        display: block;
    }
}

@media (min-width: 1024px) {
    .reg-page {
        padding: 28px 32px;
    }

    .reg-shell {
        max-width: 1140px;
        grid-template-columns: minmax(400px, 1.05fr) minmax(460px, 1fr);
        max-height: min(920px, calc(100dvh - 56px));
    }

    .reg-main {
        padding: 18px 20px;
    }

    .reg-card {
        padding: 26px 24px 28px;
    }
}

/* Hero info panel (sidebar desktop) */
.reg-aside .auth-reg-headline {
    margin: 16px 0 12px;
    font-size: 1.25rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.3;
    text-align: left;
}

.reg-aside .auth-reg-lead {
    margin: 0 0 14px;
    font-size: 0.8125rem;
    line-height: 1.65;
    color: #94a3b8;
    text-align: left;
}

.reg-aside .auth-reg-lead strong {
    color: #e2e8f0;
}

.reg-aside .auth-reg-pitch {
    margin: 0 0 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
    text-align: left;
}

.reg-aside .auth-reg-benefits {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reg-aside .auth-reg-benefit {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reg-aside .auth-reg-benefit-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.reg-aside .auth-reg-benefit-icon i {
    font-size: 0.875rem;
    color: var(--reg-icon-color, #a5b4fc);
}

.reg-aside .auth-reg-benefit-text strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #fff;
}

.reg-aside .auth-reg-benefit-text span {
    font-size: 0.75rem;
    color: #94a3b8;
}

.reg-aside .auth-reg-quote {
    margin: 0;
    padding: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    text-align: left;
}

.reg-aside .auth-reg-stars i {
    color: #fbbf24;
    font-size: 0.7rem;
}

.reg-aside .auth-reg-quote p {
    margin: 8px 0;
    font-size: 0.8125rem;
    font-style: italic;
    color: #cbd5e1;
    line-height: 1.55;
}

.reg-aside .auth-reg-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.reg-aside .auth-reg-badges span {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 4px 10px;
    border-radius: 99px;
}

.reg-back--bantuan:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Login / lupa password / reset — bawah putih (kartu tidak menggantung) */
.reg-body--auth {
    background: #fff;
}

html:has(.reg-body--auth) {
    background: #fff;
}

.reg-body--auth .reg-page,
.reg-body--auth .reg-shell,
.reg-body--auth .reg-main {
    background: #fff;
}

.reg-body--auth .reg-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.reg-body--auth .reg-aside {
    flex-shrink: 0;
}

.reg-body--auth .reg-shell {
    align-items: stretch;
}

.reg-body--auth .reg-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-top: -24px;
    padding: 0;
    border-radius: 28px 28px 0 0;
    overflow: hidden;
    box-shadow: 0 -6px 32px rgba(15, 23, 42, 0.1);
}

.reg-body--auth .reg-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 24px 20px max(28px, env(safe-area-inset-bottom));
}

/* Tablet auth — tetap putih di bawah */
@media (min-width: 640px) and (max-width: 991.98px) {
    .reg-body--auth {
        background: #f1f5f9;
    }

    html:has(.reg-body--auth) {
        background: #f1f5f9;
    }

    .reg-body--auth .reg-page {
        padding: 24px 16px 32px;
    }

    .reg-body--auth .reg-shell {
        border-radius: 32px;
        overflow: hidden;
        box-shadow:
            0 0 0 1px rgba(15, 23, 42, 0.06),
            0 24px 48px rgba(15, 23, 42, 0.12);
        background: #fff;
    }

    .reg-body--auth .reg-hero {
        border-radius: 0;
    }

    .reg-body--auth .reg-main {
        width: 100%;
        margin-top: -24px;
        padding: 0;
        border-radius: 28px 28px 0 0;
        overflow: hidden;
        box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
    }

    .reg-body--auth .reg-card {
        width: 100%;
        padding: 24px 22px 28px;
        border-radius: 0;
        box-shadow: none;
    }
}

/* Desktop auth — kartu terpusat, isi bawah putih */
@media (min-width: 992px) {
    html:has(.reg-body--auth) {
        height: auto;
        overflow-x: hidden;
        overflow-y: scroll;
        background: linear-gradient(165deg, #0f172a 0%, #1e3a5f 50%, #312e81 100%);
    }

    .reg-body--auth {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
        background: linear-gradient(165deg, #0f172a 0%, #1e3a5f 50%, #312e81 100%);
    }

    .reg-body--auth .reg-page {
        display: flex;
        height: auto;
        min-height: 100dvh;
        align-items: center;
        justify-content: center;
        padding: 24px 16px 32px;
        background: transparent;
    }

    .reg-body--auth .reg-shell {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 440px;
        height: auto;
        max-height: none;
        min-height: 0;
        overflow: hidden;
        border-radius: 32px;
        background: #fff;
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.1),
            0 32px 64px rgba(0, 0, 0, 0.35);
    }

    .reg-body--auth .reg-aside {
        height: auto;
        overflow: visible;
        background: transparent;
    }

    .reg-body--auth .reg-hero {
        height: auto;
        min-height: clamp(200px, 32dvh, 280px);
        border-radius: 0;
    }

    .reg-body--auth .reg-hero__inner {
        overflow: visible;
        flex: none;
    }

    .reg-body--auth .reg-main {
        flex: 1 1 auto;
        width: 100%;
        height: auto;
        margin-top: -24px;
        padding: 0;
        border-radius: 28px 28px 0 0;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
    }

    .reg-body--auth .reg-card {
        flex: 1 1 auto;
        width: 100%;
        min-height: 0;
        padding: 24px 22px 28px;
        border-radius: 0;
        box-shadow: none;
    }
}
