/* ============================================================
   CCS Developer Salary Fund — style.css
   Brand palette (sampled from the CCS logo):
     gold  #EBA71A · forest #2F4238 · cream #FAF6EC
     ink   #1E2A24 · muted  #5F6E60 · border #EAE2CE
   Type: Space Grotesk (display) · system stack (body)
         monospace figures for money
   ============================================================ */

:root {
    --bg:            #FAF6EC;
    --surface:       #FFFFFF;
    --ink:           #1E2A24;
    --muted:         #5F6E60;

    --gold:          #EBA71A;   /* bag body   */
    --gold-dark:     #D2920E;
    --gold-soft:     #FCF3DC;
    --green:         #2F4238;   /* bag handle */
    --green-dark:    #243529;
    --green-soft:    #EBF0EC;

    --border:        #EAE2CE;
    --danger:        #B3372E;
    --danger-soft:   #FBEDEB;
    --ring:          rgba(235, 167, 26, 0.40);

    --font-display:  "Space Grotesk", "Segoe UI", sans-serif;
    --font-body:     -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                     Helvetica, Arial, sans-serif;
    --font-money:    ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono",
                     Menlo, Consolas, monospace;

    --radius:        14px;
    --radius-sm:     10px;
    --shadow:        0 1px 2px rgba(47, 66, 56, 0.05),
                     0 12px 32px -12px rgba(47, 66, 56, 0.16);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);

    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px 40px;
    margin-top: 17vh;
        font-family: var(--font-body);
}

/* ── Header ─────────────────────────────────── */

.site-header {
    width: 100%;
    max-width: 560px;
    margin-bottom: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--ink);
}

.brand-logo {
    display: block;
    height: 46px;
    width: auto;
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.01em;
    color: var(--green);
}

/* ── Card ───────────────────────────────────── */

main {
    width: 100%;
    max-width: 560px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px 36px 30px;
}

.eyebrow {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--green);
}

h1 {
    margin: 0 0 16px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(26px, 5.4vw, 33px);
    line-height: 1.18;
    letter-spacing: -0.01em;
    color: var(--green);
}

.lead {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 15.5px;
}

/* ── Cancel notice ──────────────────────────── */

.notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0 4px;
    padding: 11px 14px;
    background: var(--gold-soft);
    border: 1px solid #F0DEAE;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: #6B4E0B;
}

.notice-close {
    flex: 0 0 auto;
    border: 0;
    background: none;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

/* ── Amount selection ───────────────────────── */

.amount-block {
    border: 0;
    padding: 0;
    margin: 26px 0 0;
}

.field-label {
    padding: 0;
    margin-bottom: 12px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 15px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.chip {
    flex: 1 1 auto;
    min-width: 62px;
    padding: 9px 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-money);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease,
                color 0.15s ease, transform 0.1s ease;
}

.chip:hover { border-color: var(--green); color: var(--green); }
.chip:active { transform: scale(0.97); }

.chip.active {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.amount-field {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 14px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    cursor: text;
}

.amount-field:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px var(--ring);
}

.amount-prefix {
    font-family: var(--font-money);
    font-size: 26px;
    font-weight: 600;
    color: var(--muted);
}

#amount {
    flex: 1;
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-family: var(--font-money);
    font-size: 32px;
    font-weight: 700;
    color: var(--green);
    padding: 0;
    letter-spacing: 0.01em;
}

.amount-suffix {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
}

.hint {
    margin: 10px 2px 0;
    font-size: 13px;
    color: var(--muted);
}

/* ── Error ──────────────────────────────────── */

.error {
    margin: 16px 0 0;
    padding: 11px 14px;
    background: var(--danger-soft);
    border: 1px solid #EFCBC7;
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 14px;
}

/* ── CTA button — gold like the bag ─────────── */

.cta {
    position: relative;
    width: 100%;
    margin-top: 20px;
    padding: 15px 20px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--gold);
    color: var(--green);
    font-family: var(--font-display);
    font-size: 16.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease,
                opacity 0.15s ease;
}

.cta:hover:not(:disabled)  { background: var(--gold-dark); }
.cta:active:not(:disabled) { transform: scale(0.99); }
.cta:disabled              { opacity: 0.55; cursor: not-allowed; }

#btn-amount { font-family: var(--font-money); }

.spinner {
    display: none;
    position: absolute;
    right: 18px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border: 2.5px solid rgba(47, 66, 56, 0.30);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.cta.loading .spinner { display: block; }
.cta.loading          { pointer-events: none; }

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

/* ── Trust & footer ─────────────────────────── */

.trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 18px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.trust svg { color: var(--green); flex: 0 0 auto; }

.portal-link {
    margin: 12px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.portal-link a { color: var(--green); font-weight: 600; }

.site-footer {
    width: 100%;
    max-width: 560px;
    margin-top: 22px;
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 12.5px;
    color: var(--muted);
}

/* ── Success page ───────────────────────────── */

.success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: var(--gold-soft);
    color: var(--green);
}

.success-amount {
    display: inline-block;
    margin: 6px 0 18px;
    padding: 8px 16px;
    background: var(--gold-soft);
    border: 1px solid #F0DEAE;
    border-radius: var(--radius-sm);
    font-family: var(--font-money);
    font-size: 22px;
    font-weight: 700;
    color: var(--green);
}

.button-link {
    display: inline-block;
    margin-top: 8px;
    padding: 13px 26px;
    border-radius: var(--radius-sm);
    background: var(--gold);
    color: var(--green);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15.5px;
    transition: background-color 0.15s ease;
}

.button-link:hover { background: var(--gold-dark); }

/* ── Accessibility & responsive ─────────────── */

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation-duration: 0.01ms !important; }
}

@media (max-width: 480px) {
    .page          { padding: 20px 14px 32px; }
    .card          { padding: 26px 20px 24px; }
    .chip          { min-width: 54px; }
    #amount        { font-size: 27px; }
    .amount-prefix { font-size: 21px; }
    .brand-logo    { height: 40px; }
}

/* ── Manage page ────────────────────────────── */

.text-field {
    display: flex;
    align-items: center;
    margin-top: 4px;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    cursor: text;
}

.text-field:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px var(--ring);
}

.text-field input {
    flex: 1;
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--ink);
    padding: 0;
}

.text-field input::placeholder { color: #A9B2A8; }

.sent-box {
    margin-top: 18px;
    padding: 14px 16px;
    background: var(--green-soft);
    border: 1px solid #D2DDD5;
    border-radius: var(--radius-sm);
    color: var(--green);
    font-size: 14.5px;
    line-height: 1.55;
}

.sent-box strong {
    display: block;
    font-family: var(--font-display);
    margin-bottom: 2px;
}

#manage-form .field-label { display: block; margin: 22px 0 0; }

/* ── One-time / Monthly toggle ──────────────── */

.mode-toggle {
    display: flex;
    gap: 4px;
    margin: 24px 0 18px;
    padding: 4px;
    background: #F3EEDF;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.mode-btn {
    flex: 1;
    padding: 10px 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-family: var(--font-display);
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease,
                box-shadow 0.15s ease;
}

.mode-btn:hover:not(.active):not(:disabled) { color: var(--green); }

.mode-btn.active {
    background: var(--surface);
    color: var(--green);
    box-shadow: 0 1px 3px rgba(47, 66, 56, 0.18);
}

.mode-btn:disabled { cursor: not-allowed; opacity: 0.7; }

.mode-toggle + .amount-block { margin-top: 0; }
