.rp {
    --rp-primary: #153E87;
    --rp-primary-dark: #0A2A5E;
    --rp-accent: #f59e0b;
    --rp-ink: #1f2937;
    --rp-muted: #6b7280;
    --rp-line: #ece7e4;
    --rp-soft: #faf6f4;
    --rp-radius: 14px;
    color: var(--rp-ink);
    font-family: inherit;
    background: var(--rp-soft);
    padding-bottom: 64px;
}

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

.rp-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

.rp a:focus-visible,
.rp button:focus-visible {
    outline: 3px solid var(--rp-accent);
    outline-offset: 2px;
}

/* Hero */
.rp-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #0A2A5E 0%, #153E87 60%, #1E5AB6 100%);
    padding: 48px 0 84px;
}

.rp-hero::before,
.rp-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
}

.rp-hero::before {
    width: 340px;
    height: 340px;
    right: -90px;
    top: -110px;
}

.rp-hero::after {
    width: 180px;
    height: 180px;
    right: 220px;
    bottom: -110px;
}

.rp-crumbs {
    position: relative;
    font-size: .85rem;
    margin: 0 0 14px;
    color: rgba(255, 255, 255, .8);
}

.rp-crumbs a {
    color: #fff;
    text-decoration: none;
}

.rp-crumbs a:hover {
    text-decoration: underline;
}

.rp-crumbs span {
    margin: 0 6px;
    opacity: .6;
}

.rp-hero h1 {
    position: relative;
    color: #fff;
    margin: 0 0 12px;
    font-weight: 700;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    line-height: 1.15;
}

.rp-hero p {
    position: relative;
    margin: 0;
    max-width: 720px;
    color: rgba(255, 255, 255, .9);
    font-size: 1.05rem;
    line-height: 1.6;
}

.rp-stats {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.rp-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    font-size: .9rem;
}

.rp-stat strong {
    font-size: 1.05rem;
}

/* Subject shortcuts */
.rp-jump {
    position: relative;
    z-index: 1;
    margin-top: -40px;
    padding: 16px 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: var(--rp-radius);
    box-shadow: 0 12px 32px rgba(17, 24, 39, .08);
}

.rp-jump-label {
    margin-right: 6px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--rp-muted);
}

.rp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--rp-soft);
    border: 1px solid var(--rp-line);
    color: var(--rp-ink);
    font-size: .9rem;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s;
}

.rp-chip b {
    color: var(--rp-accent);
}

.rp-chip:hover {
    background: #153E87;
    border-color: #0A2A5E;
    color: #fff;
}

.rp-chip:hover b {
    color: #fde68a;
}

/* Success message */
.rp-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.rp-alert i {
    font-size: 1.2rem;
}

.rp-alert-close {
    margin-left: auto;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
}

/* Subject card */
.rp-subject {
    margin-top: 28px;
    padding: 24px;
    scroll-margin-top: 120px;
    background: #fff;
    border: 1px solid var(--rp-line);
    border-radius: var(--rp-radius);
}

.rp-subject-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.rp-num {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff7ed;
    border: 2px solid var(--rp-accent);
    color: #b45309;
    font-size: 1.1rem;
    font-weight: 700;
}

.rp-subject-head h2 {
    margin: 0;
    color: var(--rp-ink);
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

.rp-subject-meta {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--rp-soft);
    color: var(--rp-muted);
    font-size: .85rem;
}

/* Levels */
.rp-levels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.rp-level {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: #fffdfc;
    border: 1px solid var(--rp-line);
    border-top: 4px solid #153E87;
    border-radius: 12px;
    transition: box-shadow .2s, transform .2s;
}

.rp-level:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(155, 28, 46, .08);
}

.rp-level-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.rp-level-head h3 {
    margin: 0;
    color: #1f3c88;
    font-size: 1rem;
    font-weight: 700;
}

.rp-level-head small {
    color: var(--rp-muted);
    font-size: .75rem;
}

/* PDFs */
.rp .rp-docs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.rp-doc {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--rp-line);
    border-radius: 10px;
}

.rp-doc-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef2f2;
    color: #dc2626;
    font-size: 1.05rem;
}

.rp-doc-body {
    flex: 1;
    min-width: 0;
}

.rp-doc-title {
    margin: 0;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}

.rp-doc-desc {
    margin: 3px 0 0;
    color: var(--rp-muted);
    font-size: .8rem;
    line-height: 1.4;
}

.rp-doc-size {
    display: block;
    margin-top: 3px;
    color: var(--rp-muted);
    font-size: .72rem;
}

.rp-doc-btn {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    background: var(--rp-primary);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.rp-doc-btn:hover {
    background: var(--rp-primary-dark);
}

.rp-doc-btn:disabled {
    opacity: .6;
    cursor: wait;
}

.rp-soon {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px 8px;
    text-align: center;
    border: 1px dashed var(--rp-line);
    border-radius: 10px;
    color: var(--rp-muted);
    font-size: .85rem;
}

.rp-soon i {
    font-size: 1.3rem;
    opacity: .5;
}

.rp-empty {
    margin-top: 28px;
    padding: 64px 16px;
    text-align: center;
    background: #fff;
    border: 1px dashed var(--rp-line);
    border-radius: var(--rp-radius);
    color: var(--rp-muted);
}

.rp-empty i {
    display: block;
    margin-bottom: 12px;
    font-size: 2.5rem;
    color: var(--rp-primary);
    opacity: .4;
}

/* Download form */
.rp-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, .6);
    backdrop-filter: blur(2px);
}

.rp-modal {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .25);
    animation: rp-pop .2s ease-out;
}

.rp-modal-head {
    padding: 22px 56px 22px 24px;
    color: #fff;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(135deg, var(--rp-primary-dark), var(--rp-primary));
}

.rp-modal-tag {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .85;
}

.rp-modal-head h2 {
    margin: 6px 0 0;
    color: #fff;
    font-size: 1.15rem;
    line-height: 1.35;
}

.rp-modal-head p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, .85);
    font-size: .85rem;
}

.rp-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
}

.rp-close:hover {
    background: rgba(255, 255, 255, .3);
}

.rp-form {
    padding: 22px 24px 24px;
}

.rp-form-intro {
    margin: 0 0 18px;
    color: var(--rp-muted);
    font-size: .9rem;
}

.rp-field {
    margin-bottom: 14px;
}

.rp .rp-field label {
    display: block;
    margin: 0 0 6px;
    color: var(--rp-ink);
    font-size: .85rem;
    font-weight: 600;
}

.rp-field label span {
    color: #dc2626;
}

.rp-input {
    position: relative;
}

.rp-input i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: .9rem;
    pointer-events: none;
}

.rp .rp-input input {
    width: 100%;
    height: auto;
    margin: 0;
    padding: 11px 12px 11px 38px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    box-shadow: none;
    font: inherit;
    font-size: .95rem;
    color: var(--rp-ink);
    transition: border-color .2s, box-shadow .2s;
}

.rp .rp-input input:focus {
    outline: none;
    border-color: var(--rp-primary);
    box-shadow: 0 0 0 3px rgba(155, 28, 46, .15);
}

.rp .rp-field.has-error input {
    border-color: #dc2626;
}

.rp-error {
    display: block;
    margin-top: 5px;
    color: #b91c1c;
    font-size: .8rem;
}

.rp-submit {
    width: 100%;
    margin-top: 6px;
    padding: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 10px;
    background: var(--rp-primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}

.rp-submit:hover {
    background: var(--rp-primary-dark);
}

.rp-submit:disabled {
    opacity: .7;
    cursor: wait;
}

.rp-cancel {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--rp-muted);
    font-size: .9rem;
    cursor: pointer;
}

.rp-cancel:hover {
    background: var(--rp-soft);
}

.rp-privacy {
    margin: 14px 0 0;
    text-align: center;
    color: var(--rp-muted);
    font-size: .78rem;
}

.rp-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@keyframes rp-pop {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 640px) {
    .rp-hero {
        padding: 32px 0 72px;
    }

    .rp-bulkbar {
        padding: 8px;
    }

    .rp-bulkbar-inner {
        flex-wrap: wrap;
    }

    .rp-bulkbar-btn {
        flex: 1;
        justify-content: center;
    }

    .rp-subject {
        padding: 16px;
    }

    .rp-subject-meta {
        margin-left: 0;
    }

    .rp-levels {
        grid-template-columns: 1fr;
    }

    .rp-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .rp-modal {
        max-width: none;
        max-height: 92vh;
        border-radius: 18px 18px 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    .rp *,
    .rp *::before,
    .rp *::after {
        animation: none !important;
        transition: none !important;
    }
}


/* Phone field (intl-tel-input) */
.rp .iti {
    display: block;
    width: 100%;
}

.rp .iti input[type="tel"] {
    width: 100%;
    height: auto;
    margin: 0;
    padding-top: 11px;
    padding-bottom: 11px;
    padding-right: 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    box-shadow: none;
    font: inherit;
    font-size: .95rem;
    color: var(--rp-ink);
    transition: border-color .2s, box-shadow .2s;
}

.rp .iti input[type="tel"]:focus {
    outline: none;
    border-color: var(--rp-primary);
    box-shadow: 0 0 0 3px rgba(155, 28, 46, .15);
}

.rp .rp-field.has-error .iti input[type="tel"] {
    border-color: #dc2626;
}

.rp .iti__selected-country {
    border-radius: 10px 0 0 10px;
}

.rp .iti__selected-country-primary {
    padding: 0 6px 0 12px;
}

.rp .iti__selected-dial-code {
    font-size: .95rem;
    color: var(--rp-ink);
}

.rp .iti__country-list {
    font-size: .9rem;
}

.rp .iti__search-input {
    margin: 0;
    height: auto;
    padding: 8px 10px;
}

/* Keep the country list above the download form on phones */
.iti--container {
    z-index: 10050 !important;
}


[x-cloak] {
    display: none !important;
}

/* ---- Select for bulk download ---- */
.rp-doc.is-selected {
    border-color: var(--rp-primary);
    box-shadow: 0 0 0 2px rgba(155, 28, 46, .15);
}

.rp-doc-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.rp-doc-actions .rp-doc-btn {
    margin-top: 0;
}

.rp-pick {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--rp-line);
    border-radius: 8px;
    background: #fff;
    font-size: .78rem;
    font-weight: 600;
    color: var(--rp-ink);
    cursor: pointer;
    user-select: none;
}

.rp .rp-pick input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--rp-primary);
    cursor: pointer;
}

.rp-pick.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}

.rp-pick.is-disabled input {
    cursor: not-allowed;
}

/* ---- Bottom bar ---- */
.rp-bulkbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9000;
    padding: 12px 16px;
    pointer-events: none;
}

.rp-bulkbar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
    padding: 12px 14px 12px 18px;
    border-radius: 16px;
    background: #16295c;
    color: #fff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
    pointer-events: auto;
    animation: rp-pop .2s ease-out;
}

.rp-bulkbar-text {
    flex: 1;
    min-width: 0;
    font-size: .9rem;
}

.rp-bulkbar-text small {
    display: block;
    color: #fde68a;
    font-size: .75rem;
}

.rp-bulkbar-clear {
    padding: 8px 10px;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, .8);
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
}

.rp-bulkbar-clear:hover {
    color: #fff;
    text-decoration: underline;
}

.rp-bulkbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--rp-accent);
    color: #1f2937;
    font: inherit;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
}

.rp-bulkbar-btn:hover {
    filter: brightness(1.05);
}

/* ---- Form: list of selected PDFs ---- */
.rp .rp-modal-list {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 4px;
    font-size: .85rem;
    color: rgba(255, 255, 255, .92);
}

.rp-modal-list i {
    margin-right: 6px;
    opacity: .8;
}

/* ---- Ready to download ---- */
.rp-ready {
    padding: 22px 24px 24px;
}

.rp .rp-ready-note {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: .88rem;
    line-height: 1.45;
}

.rp .rp-ready-list {
    display: grid;
    gap: 10px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.rp-ready-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--rp-line);
    border-radius: 12px;
}

.rp-ready-title {
    flex: 1;
    min-width: 0;
    font-size: .88rem;
    font-weight: 600;
    word-break: break-word;
}

.rp-ready-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 9px;
    white-space: nowrap;
    background: var(--rp-primary);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
}

.rp-ready-btn:hover {
    background: var(--rp-primary-dark);
    color: #fff;
}

.rp-ready-btn.is-done {
    background: #16a34a;
}

.rp .rp-ready-hint {
    margin: 0 0 14px;
    text-align: center;
    font-size: .78rem;
    color: var(--rp-muted);
}
