/* repconnect — landing fixes + onboarding / offers board / billing components.
   built only on the tokens already in main.css: no new fonts, no new colours. */

/* ---------------------------------------------------------------- fixes */

/* main.css sets body{overflow:hidden}, which makes body a scroll container.
   the absolutely positioned .gradient-container boxes give it ~445px of
   scrollable overflow, so a #fragment jump scrolls body internally and the
   wheel cannot put it back. clip clips the same way without scrolling. */
body { overflow: clip; }

/* section.hero:before is the bottom fade and sits at z-index 1, on top of the
   hero cta. lift the content over it, but leave .gradient-container behind the
   fade: raising the whole .section-content pulls the glow up with it. */
section.hero .section-content > *:not(.gradient-container) { position: relative; z-index: 2; }

/* the glow box is a fixed 1440px tall and section.hero{overflow:hidden} clips
   it. with the short hero that clip lands mid glow and reads as a hard line.
   match the box to the hero so the radial reaches zero on its own edge. */
section.hero .gradient-container,
section.hero .gradient-container .gradient { height: 100%; }

/* .card sets display:flex, which beats the ua sheet's [hidden]{display:none} */
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- layout */

section.page {
    padding-top: calc(var(--header-height) + var(--padding-medium));
    margin-bottom: var(--padding-large);
}

section.page .section-content {
    align-items: stretch;
    gap: var(--padding-small);
}

.stack { display: flex; flex-direction: column; gap: var(--padding-small); }
.stack.tight { gap: var(--padding-extra-small); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.centered { align-items: center; text-align: center; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--color-secondary); }
.breadcrumb a { font-weight: 400; color: var(--color-secondary); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb strong { color: var(--color-primary); }
.breadcrumb svg { width: 14px; height: 14px; opacity: .5; }

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background-color: var(--color-background-elevation);
    font-size: 12px;
    font-weight: 500;
}
.pill.green { background-color: var(--green); color: var(--black); }
.pill.red { background-color: var(--red); color: var(--black); }

/* ---------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 10px; }
.field > .label { font-weight: 500; font-size: 18px; }
.field > .hint { font-size: 14px; color: var(--color-secondary); }

.input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--border-radius-medium);
    background-color: var(--color-background-elevation);
    color: var(--color-primary);
    font-size: 16px;
}
.input::placeholder { color: var(--color-secondary); }
.input:focus { border-color: var(--green); }
.input:-webkit-autofill,
.input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--color-primary);
    -webkit-box-shadow: 0 0 0 1000px var(--color-background-secondary) inset;
}

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; display: inline-flex; }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice span {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 20px;
    background-color: var(--color-background-elevation);
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: background-color .1s ease, color .1s ease;
}
.choice input:checked + span { background-color: var(--green); color: var(--black); }
.choice input:focus-visible + span { border-color: var(--color-primary); }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--padding-extra-small); }
.field-grid .span-2 { grid-column: span 2; }
@media only screen and (max-width: 512px) {
    .field-grid { grid-template-columns: 1fr; }
    .field-grid .span-2 { grid-column: span 1; }
}

.form-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-top: var(--padding-extra-small); }
.form-actions .button { width: 100%; max-width: 384px; }

/* ---------------------------------------------------------------- access key */

.pin-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.pin { display: flex; gap: 12px; }
.pin input {
    width: 56px;
    height: 64px;
    border: 1px solid transparent;
    border-radius: var(--border-radius-medium);
    background-color: var(--color-background-elevation);
    color: var(--color-primary);
    font-family: "DM Mono", monospace;
    font-size: 28px;
    text-align: center;
    text-transform: uppercase;
}
.pin input:focus { border-color: var(--green); }
.pin.error input { border-color: var(--red); }
.pin-submit { width: 64px; height: 64px; padding: 0; }
.pin-submit svg { width: 24px; height: 24px; }
@media only screen and (max-width: 512px) {
    .pin input { width: 44px; height: 56px; font-size: 22px; }
    .pin-submit { width: 56px; height: 56px; }
}

/* ---------------------------------------------------------------- dialog */

dialog.modal {
    width: min(520px, calc(100vw - 32px));
    padding: var(--padding-small);
    border: none;
    border-radius: var(--border-radius-large);
    background-color: var(--color-background-primary);
    color: var(--color-primary);
}
dialog.modal::backdrop { backdrop-filter: blur(4px); background-color: rgba(0, 0, 0, .6); }
dialog.modal .modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
dialog.modal .close { width: 32px; height: 32px; padding: 0; border-radius: var(--border-radius-small); background-color: var(--color-background-elevation); color: var(--color-primary); }

/* ---------------------------------------------------------------- header extras */

header .header-content nav .icon-button {
    display: inline-flex;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border-radius: var(--border-radius-small);
    background-color: var(--color-background-elevation);
}
header .header-content nav .icon-button svg { width: 20px; height: 20px; }
.notif { position: relative; }
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background-color: var(--red);
    color: var(--black);
    font-size: 11px;
    font-weight: 500;
    line-height: 18px;
    text-align: center;
}
.notif-panel {
    display: none;
    z-index: 20;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(360px, calc(100vw - 32px));
    padding: var(--padding-extra-small);
    border-radius: var(--border-radius-medium);
    backdrop-filter: blur(24px);
    background-color: var(--color-background-secondary);
}
.notif-panel.open { display: block; }
.notif-panel .notif-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.notif-panel .notif-head strong { font-size: 16px; }
.notif-panel .notif-head button { height: auto; padding: 0; background: none; color: var(--color-secondary); font-size: 14px; }
.notif-panel .notif-item { display: flex; gap: 12px; padding: 10px 8px; border-radius: var(--border-radius-small); }
.notif-panel .notif-item:hover { background-color: var(--color-background-elevation); }
.notif-panel .notif-item .dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 4px; background-color: var(--green); flex: none; }
.notif-panel .notif-item.read .dot { background-color: var(--color-secondary); opacity: .4; }
.notif-panel .notif-item .text { display: flex; flex-direction: column; }
.notif-panel .notif-item .text span { font-size: 15px; }
.notif-panel .notif-foot { display: block; margin-top: 4px; padding: 10px; border-radius: var(--border-radius-small); text-align: center; font-size: 14px; }
.notif-panel .notif-foot:hover { background-color: var(--color-background-elevation); }

/* the site dropdown opens on hover; in the dashboard it is click driven */
header .header-content nav .dropdown.menu .dropdown-content.open { opacity: 1 !important; max-height: 320px !important; }

/* ---------------------------------------------------------------- offers board */

/* one stacked monorail. the track scrolls natively, so a touch swipe and the
   side buttons drive the same scroll and mobile needs no extra code. */
.rail { position: relative; width: 100%; }
.rail.has-nav { padding: 0 44px; }
.offers {
    display: flex;
    /* every card owns its own height. the default stretch sizes the flex line to
       the tallest item, so opening one <details> grew all three card boxes and
       closing one shrank nothing until the last one was closed. */
    align-items: flex-start;
    gap: var(--padding-small);
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}
.offers::-webkit-scrollbar { display: none; }
/* three per view, so the rail lines up with the header above it and the next
   set is one page away. */
.offer { display: flex; flex: 0 0 calc((100% - var(--padding-small) * 2) / 3); flex-direction: column; gap: 8px; scroll-snap-align: start; }
/* max-width only: .card caps at 512px below 1024. no flex:1 here — that is what
   handed a stretched .offer's height to the card box. */
.offer > .card { max-width: 100%; }
@media only screen and (max-width: 1024px) { .offer { flex-basis: calc((100% - var(--padding-small)) / 2); } }
@media only screen and (max-width: 640px) { .offer { flex-basis: 86%; } }

.rail-nav {
    display: flex;
    z-index: 2;
    position: absolute;
    top: calc(50% - 18px);
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 18px;
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    background-color: var(--color-background-secondary);
    color: var(--color-primary);
}
.rail-nav.prev { left: 0; }
.rail-nav.next { right: 0; }
.rail-nav svg { width: 20px; height: 20px; }
.rail-nav[disabled] { opacity: .3; cursor: default; }

/* touch: the swipe is the affordance, the overlay buttons only get in the way */
@media (pointer: coarse) {
    .rail.has-nav { padding: 0; }
    .rail-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) { .offers { scroll-behavior: auto; } }

.offer .ote { font-weight: 500; font-size: 20px; letter-spacing: -.5px; }
.offer .card { gap: var(--padding-extra-small); }
.offer summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.offer summary::-webkit-details-marker { display: none; }
.offer summary .role { font-weight: 500; font-size: 20px; line-height: 1.25; }
.offer summary .amount { font-size: 15px; color: var(--color-secondary); }
.offer summary .chev { flex: none; width: 20px; height: 20px; transition: transform .15s ease; }
.offer .card[open] summary .chev { transform: rotate(180deg); }
.offer .detail { display: flex; flex: 1; flex-direction: column; gap: var(--padding-extra-small); }
.offer .detail dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 15px; }
.offer .detail dt { color: var(--color-secondary); }
.offer .detail dd { margin: 0; font-weight: 500; }
.offer .detail .button {
    align-self: center;
    margin-top: auto;
    width: 100%;
    height: auto;
    min-height: 36px;
    padding: 8px 16px;
    white-space: normal;
    text-align: center;
}
.offer .detail .button[disabled] { background-color: var(--color-background-elevation); color: var(--color-secondary); cursor: default; }

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--padding-medium) var(--padding-small);
    text-align: center;
}
.empty svg { width: 64px; height: 64px; margin-bottom: 8px; }
.empty strong { font-size: 20px; }
.empty p { max-width: 360px; font-size: 16px; }

/* ---------------------------------------------------------------- board preview */

/* section 3 on the landing page shows a still of the offers board, built from the
   same parts as the live one in offers.html. */
.preview { gap: var(--padding-extra-small); }
.preview .preview-head { display: flex; align-items: center; gap: 8px; }
.preview .preview-head strong { font-weight: 500; font-size: 18px; }
.preview .board { display: flex; gap: var(--padding-extra-small); }
.preview .tile { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 6px; }
.preview .ote { font-weight: 500; font-size: 15px; }
.preview .offer-still {
    display: flex;
    flex: 1;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: var(--padding-extra-small);
    border-radius: var(--border-radius-medium);
    background-color: var(--color-background-primary);
}
.preview .offer-still .role { font-weight: 500; font-size: 15px; line-height: 1.25; }
.preview .offer-still .amount { font-size: 13px; color: var(--color-secondary); }
.preview .offer-still svg { flex: none; width: 16px; height: 16px; }
/* the grid caps a card at 512px below 1024, too narrow for three tiles abreast */
@media only screen and (max-width: 1024px) { .preview .board { flex-direction: column; } }

/* ---------------------------------------------------------------- keywords */

.keywords {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: var(--border-radius-medium);
    background-color: var(--color-background-elevation);
}
.keywords:focus-within { border-color: var(--green); }
.keyword {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 4px 0 12px;
    border-radius: 16px;
    background-color: var(--green);
    color: var(--black);
    font-weight: 500;
    font-size: 14px;
}
.keyword button { width: 24px; height: 24px; padding: 0; border-radius: 12px; background: none; color: var(--black); font-size: 16px; }
.keyword button:hover { background-color: rgba(0, 0, 0, .12); opacity: 1; }
.keywords input { flex: 1; min-width: 140px; height: 32px; padding: 0 8px; background: none; color: var(--color-primary); font-size: 16px; }

/* ---------------------------------------------------------------- accordion + plans */

.accordion { display: flex; flex-direction: column; }
.accordion .item { border-top: 1px solid var(--color-background-elevation); }
.accordion .item:first-child { border-top: none; }
.accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: var(--padding-extra-small) 0;
    cursor: pointer;
    list-style: none;
    font-weight: 500;
    font-size: 20px;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary .chev { flex: none; width: 20px; height: 20px; transition: transform .15s ease; }
.accordion .item[open] summary .chev { transform: rotate(180deg); }
.accordion .body { display: flex; flex-direction: column; gap: var(--padding-extra-small); padding-bottom: var(--padding-small); }

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: var(--padding-small); }
@media only screen and (max-width: 768px) { .plans { grid-template-columns: 1fr; } }
.plan .price { font-weight: 500; font-size: 40px; letter-spacing: -1px; }
.plan .price small { font-size: 16px; letter-spacing: 0; }
/* the price stays in the dom, it is only obscured so this tier routes
   through a call instead of self serve checkout. */
.plan .price.obscured { filter: blur(5px); user-select: none; }
.plan ul { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.plan li { display: flex; gap: 10px; font-size: 16px; color: var(--color-secondary); }
.plan li svg { flex: none; width: 18px; height: 18px; margin-top: 3px; }
.plan .button { width: 100%; margin-top: auto; }

.narrow { width: 100%; max-width: 720px; margin: 0 auto; }
.narrow.slim { max-width: 520px; }
.card.plain { background-color: rgba(0, 0, 0, 0); padding: 0; }

.row-between > .stack { flex: 1; min-width: 260px; }

/* ---------------------------------------------------------------- hover states */

/* main.css fades every button to .8 opacity on hover. that washes the green out,
   does nothing readable for the grey ones, and reads as a dimmer rather than a
   response. replace it with a 1px lift plus one real colour step. */
:root.theme-light { --hover-elevation: rgba(0, 0, 0, .09); }
:root.theme-dark { --hover-elevation: rgba(255, 255, 255, .1); }

button, .button, .choice span, .theme-switch label {
    transition: transform .15s ease, background-color .15s ease, color .15s ease, opacity .15s ease;
}
button:not([disabled]):active, .button:not([disabled]):active { transform: translateY(0); }

/* touch taps leave :hover stuck on, so the lift is for pointers only */
@media (hover: hover) {
    button:not([disabled]):hover, .button:not([disabled]):hover,
    .choice span:hover, .theme-switch label:hover { opacity: 1; transform: translateY(-1px); }

    /* filled surfaces step one shade darker */
    .button:not([disabled]):hover, .pin-submit:hover { background-color: color-mix(in srgb, var(--green) 88%, var(--black)); }
    .button.yellow:hover { background-color: color-mix(in srgb, var(--yellow) 88%, var(--black)); }
    .button.grey:hover { background-color: #999; }

    /* neutral surfaces step one shade stronger */
    .button.secondary:hover,
    dialog.modal .close:hover,
    header .header-content nav .icon-button:hover,
    header .header-content nav .dropdown:hover { background-color: var(--hover-elevation); }
    header .header-content nav .dropdown:hover { border-radius: var(--border-radius-small); }
    .rail-nav:not([disabled]):hover { background-color: color-mix(in srgb, var(--color-background-secondary) 92%, var(--color-primary)); }

    /* the onboarding pills and the theme toggle behave like buttons */
    .choice input:not(:checked) + span:hover,
    .theme-switch input:not(:checked) + label:hover { background-color: var(--hover-elevation); opacity: 1; }
    .choice input:checked + span:hover,
    .theme-switch input:checked + label:hover { background-color: color-mix(in srgb, var(--green) 88%, var(--black)); opacity: 1; }

    /* no surface to shade, and nothing worth lifting: these shift colour instead */
    .theme-switch:hover, .keyword button:hover,
    header .header-content nav .dropdown .dropdown-button:hover { transform: none; }
    .notif-panel .notif-head button:hover { transform: none; color: var(--color-primary); }
}

/* ---------------------------------------------------------------- logo mark */

/* the mark from the footer, at header scale. currentColor so it follows the
   theme exactly like the wordmark beside it. */
header .header-content .logo { display: inline-flex; align-items: center; gap: 8px; }
header .header-content .logo .logo-mark { flex: none; width: 22px; height: 22px; }

/* ---------------------------------------------------------------- key recovery */

#recover .pin-row { gap: 8px; margin-top: 4px; }
#recover .input { max-width: 320px; }
#recover .button { flex: none; }
