@font-face { font-family: "Prata"; src: url("../fonts/Prata-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-SemiBold.ttf") format("truetype"); font-weight: 600 800; font-display: swap; }

:root {
    color-scheme: light;
    --paper: #fbf8f4;
    --surface: #fffdfb;
    --ink: #2d294d;
    --text: #514e5e;
    --muted: #888491;
    --line: #ded9d5;
    --peach: #ff987b;
    --peach-soft: #ffe4da;
    --lavender: #aaa0ef;
    --lavender-soft: #efedff;
    --success: #237b55;
    --danger: #a5444d;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body {
    min-width: 320px;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(ellipse 34rem 22rem at 5% 4%, rgba(255, 152, 123, .16), transparent 70%),
        radial-gradient(ellipse 38rem 25rem at 96% 30%, rgba(170, 160, 239, .15), transparent 70%),
        var(--paper);
    font-family: "Manrope", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; }
button, input { font: inherit; }
button { color: inherit; }

.portal-header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid rgba(222, 217, 213, .86);
    background: rgba(251, 248, 244, .88);
    backdrop-filter: blur(18px);
}
.portal-header__inner {
    display: flex;
    width: min(1180px, calc(100% - 40px));
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    margin: auto;
    gap: 24px;
}
.portal-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-family: "Prata", serif; font-size: 22px; text-decoration: none; }
.portal-brand img { width: 36px; height: 36px; object-fit: contain; }
.portal-header__actions { display: flex; align-items: center; gap: 20px; font-size: 13px; }
.portal-header__actions form { margin: 0; }
.portal-header__actions button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }

.access-shell { display: grid; min-height: calc(100vh - 166px); place-items: center; padding: 64px 20px 80px; }
.access-card { position: relative; overflow: hidden; width: min(100%, 560px); padding: clamp(34px, 7vw, 62px); border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 253, 251, .94); box-shadow: 0 30px 90px rgba(45, 41, 77, .09); }
.access-card__mark { position: absolute; top: -46px; right: -34px; width: 180px; height: 160px; transform: rotate(-8deg); pointer-events: none; }
.access-card__mark span { position: absolute; border-radius: 50%; filter: blur(.2px); }
.access-card__mark span:first-child { inset: 0 48px 32px 0; background: rgba(255, 152, 123, .20); }
.access-card__mark span:last-child { inset: 50px 0 0 58px; background: rgba(170, 160, 239, .18); }
.eyebrow { margin: 0 0 12px; color: var(--ink); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1, h2 { margin: 0; color: var(--ink); font-family: "Prata", Georgia, serif; font-weight: 400; letter-spacing: -.035em; line-height: 1.12; }
.access-card h1 { position: relative; max-width: 440px; font-size: clamp(2.5rem, 8vw, 4.2rem); }
.access-lead { max-width: 450px; margin: 22px 0 30px; line-height: 1.7; }
.access-form { display: grid; gap: 10px; }
.access-form label { color: var(--ink); font-size: 13px; font-weight: 700; }
.access-form input { width: 100%; min-height: 54px; padding: 0 15px; border: 1px solid #cfc9c5; border-radius: 6px; outline: none; background: #fff; color: var(--ink); }
.access-form input:focus { border-color: var(--lavender); box-shadow: 0 0 0 3px rgba(170, 160, 239, .16); }
.access-form input[name="code"] { font-size: 24px; font-weight: 700; letter-spacing: .24em; text-align: center; }
.field-hint, .privacy-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.privacy-note { margin-top: 24px; }
.field-error { margin: 0; color: var(--danger); font-size: 12px; }
.form-alert, .dev-code { margin: 0 0 22px; padding: 12px 14px; border-left: 3px solid var(--danger); background: #fff2f1; color: var(--danger); font-size: 13px; }
.dev-code { border-color: var(--lavender); background: var(--lavender-soft); color: var(--ink); }
.primary-button { display: inline-flex; min-height: 54px; align-items: center; justify-content: center; margin-top: 12px; padding: 0 22px; border: 1px solid var(--ink); border-radius: 6px; background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; }
.primary-button:hover { background: #403a6c; }
.text-button { width: 100%; margin-top: 18px; border: 0; background: transparent; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.link-selected { display: grid; margin-bottom: 10px; padding: 16px; border-left: 3px solid var(--lavender); background: var(--lavender-soft); gap: 4px; }
.link-selected strong { color: var(--ink); }
.link-selected span { font-size: 13px; line-height: 1.55; }

.portal-main { width: min(1180px, calc(100% - 40px)); margin: 42px auto 90px; }
.notice { margin-bottom: 18px; padding: 14px 17px; border-left: 3px solid var(--success); background: #edf8f2; color: var(--success); font-size: 14px; }
.notice--error { border-color: var(--danger); background: #fff1f1; color: var(--danger); }
.space-hero { position: relative; display: grid; overflow: hidden; min-height: 350px; padding: clamp(32px, 6vw, 68px); border: 1px solid var(--line); background: var(--surface); grid-template-columns: auto 1fr auto; align-items: center; gap: 30px; }
.space-hero__art { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.space-hero__art span, .space-hero__art i { position: absolute; display: block; border-radius: 50%; }
.space-hero__art span:first-child { width: 430px; height: 210px; top: -70px; right: -60px; transform: rotate(-13deg); background: rgba(255, 152, 123, .20); }
.space-hero__art span:nth-child(2) { width: 360px; height: 180px; right: 120px; bottom: -95px; transform: rotate(18deg); background: rgba(170, 160, 239, .19); }
.space-hero__art i { width: 56px; height: 56px; top: 58px; right: 34%; background: rgba(255, 152, 123, .34); }
.space-hero__avatars { position: relative; display: flex; padding-left: 18px; }
.member-avatar { display: grid; width: 88px; height: 88px; overflow: hidden; place-items: center; margin-left: -18px; border: 4px solid var(--surface); border-radius: 50%; background: var(--lavender-soft); color: var(--ink); font-family: "Prata", serif; font-size: 30px; }
.member-avatar:nth-child(2) { background: var(--peach-soft); }
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.space-hero__copy { position: relative; }
.space-hero__copy h1 { font-size: clamp(3rem, 7vw, 6rem); }
.space-hero__copy > p:last-child { margin: 13px 0 0; font-size: 18px; }
.access-state { position: relative; display: grid; min-width: 210px; padding: 22px 0 22px 26px; border-left: 1px solid var(--line); gap: 5px; }
.access-state span, .access-state small { color: var(--muted); font-size: 12px; }
.access-state strong { color: var(--ink); font-size: 20px; }

.checkout-section, .history-section { padding: clamp(58px, 8vw, 100px) 0; border-bottom: 1px solid var(--line); }
.section-heading { max-width: 760px; }
.section-heading h2 { font-size: clamp(2.5rem, 5vw, 4.8rem); }
.section-heading > p:last-child { max-width: 650px; margin: 20px 0 0; line-height: 1.7; }
.section-heading--row { display: flex; max-width: none; align-items: end; justify-content: space-between; gap: 40px; }
.section-heading--row > p { max-width: 390px; margin: 0; color: var(--muted); font-size: 13px; }
.plan-grid { display: grid; margin-top: 44px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); grid-template-columns: repeat(4, 1fr); }
.plan-option { position: relative; min-width: 0; cursor: pointer; }
.plan-option input { position: absolute; opacity: 0; pointer-events: none; }
.plan-option__content { display: flex; min-height: 180px; flex-direction: column; justify-content: space-between; padding: 25px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.5); transition: background .2s, color .2s; }
.plan-option__content span { color: var(--muted); font-size: 13px; }
.plan-option__content strong { color: var(--ink); font-family: "Prata", serif; font-size: clamp(1.8rem, 3vw, 2.7rem); font-weight: 400; }
.plan-option__content small { color: var(--peach); font-weight: 700; }
.plan-option input:checked + .plan-option__content { background: var(--ink); color: #fff; }
.plan-option input:checked + .plan-option__content span, .plan-option input:checked + .plan-option__content strong { color: #fff; }
.plan-option input:focus-visible + .plan-option__content { outline: 3px solid rgba(170,160,239,.7); outline-offset: -3px; }
.primary-button--pay { min-width: 300px; margin-top: 28px; }
.checkout-disabled { margin-top: 28px; padding: 16px 18px; border-left: 3px solid var(--lavender); background: var(--lavender-soft); color: var(--ink); }
.offer-note { max-width: 660px; margin: 18px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }

.payment-list { margin-top: 42px; border-top: 1px solid var(--line); }
.payment-row { display: grid; padding: 23px 0; border-bottom: 1px solid var(--line); grid-template-columns: minmax(260px, 1fr) 190px 180px; align-items: center; gap: 24px; }
.payment-row h3 { margin: 7px 0 4px; color: var(--ink); font-size: 16px; }
.payment-row p { margin: 0; color: var(--muted); font-size: 12px; }
.status { display: inline-flex; padding: 4px 7px; border: 1px solid currentColor; border-radius: 4px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.status--success { color: var(--success); }
.status--failed { color: var(--danger); }
.status--processing { color: #8a6318; }
.status--refunded { color: #476082; }
.payment-row__amount { display: grid; gap: 5px; }
.payment-row__amount strong { color: var(--ink); font-size: 18px; }
.payment-row__amount small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; }
.payment-row__action { text-align: right; }
.payment-row__action button { padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--danger); font-size: 12px; font-weight: 700; cursor: pointer; }
.payment-row__action span { color: var(--muted); font-size: 12px; }
.empty-history { margin-top: 38px; padding: 32px 0; border-block: 1px solid var(--line); color: var(--muted); }

.portal-footer { display: flex; width: min(1180px, calc(100% - 40px)); min-height: 92px; align-items: center; justify-content: space-between; margin: auto; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; gap: 24px; }
.portal-footer nav { display: flex; gap: 20px; }

@media (max-width: 850px) {
    .space-hero { grid-template-columns: auto 1fr; }
    .access-state { grid-column: 1 / -1; min-width: 0; padding: 18px 0 0; border-top: 1px solid var(--line); border-left: 0; }
    .plan-grid { grid-template-columns: repeat(2, 1fr); }
    .payment-row { grid-template-columns: 1fr auto; }
    .payment-row__action { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 620px) {
    .portal-header__inner, .portal-main, .portal-footer { width: min(100% - 28px, 1180px); }
    .portal-header__inner { min-height: 66px; }
    .portal-brand { font-size: 19px; }
    .portal-brand img { width: 32px; height: 32px; }
    .portal-header__actions > a { display: none; }
    .access-shell { align-items: start; padding: 24px 14px 50px; }
    .access-card { padding: 32px 22px; }
    .portal-main { margin-top: 20px; }
    .space-hero { min-height: 0; padding: 30px 22px; grid-template-columns: 1fr; gap: 20px; }
    .space-hero__avatars { padding-left: 14px; }
    .member-avatar { width: 70px; height: 70px; }
    .space-hero__copy h1 { font-size: clamp(2.8rem, 15vw, 4.2rem); }
    .space-hero__copy > p:last-child { font-size: 15px; }
    .checkout-section, .history-section { padding: 60px 0; }
    .section-heading h2 { font-size: clamp(2.45rem, 13vw, 3.5rem); }
    .section-heading--row { align-items: start; flex-direction: column; gap: 18px; }
    .plan-grid { margin-top: 32px; }
    .plan-option__content { min-height: 145px; padding: 18px 14px; }
    .plan-option__content strong { font-size: 1.7rem; }
    .primary-button--pay { width: 100%; min-width: 0; }
    .payment-row { grid-template-columns: 1fr; gap: 14px; }
    .payment-row__action { grid-column: auto; }
    .portal-footer { min-height: 0; padding: 26px 0; flex-direction: column; align-items: flex-start; }
    .portal-footer nav { flex-wrap: wrap; gap: 12px 18px; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}
