/* MotionCred affiliate program and admin pages · builds on css/site.css (everyday palette) */

.aff-page { background: var(--paper); }
.aff-main { min-height: 60vh; padding-bottom: 60px; }
.aff-area { font: 700 .75rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--glow); border: 1px solid rgba(247, 241, 229, .3); border-radius: 999px; padding: .45em .8em; }
.aff-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 20px; margin-left: auto; }
.aff-nav a { color: var(--on-night-muted); text-decoration: none; font-weight: 600; font-size: .98rem; }
.aff-nav a:hover, .aff-nav a[aria-current="page"] { color: var(--on-night); }
.aff-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--glow); text-underline-offset: .35em; }
.aff-nav .btn { color: var(--btn-ink); }
.aff-signout { margin: 0; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }
.aff-nav .linkish { color: var(--on-night-muted); }
.aff-nav .linkish:hover { color: var(--on-night); }
@media (max-width: 760px) {
  .header-row { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .aff-nav { width: 100%; margin-left: 0; gap: 4px 16px; }
  .aff-area { display: none; }
}

.aff-section { padding-top: clamp(28px, 4vw, 48px); }
.aff-section h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
.aff-section h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.aff-section .h3, .aff-section h2.h3 { font-size: 1.5rem; margin-top: 1.4em; }
.h4 { font: 700 1.05rem/1.3 var(--body); margin: 1.2em 0 .5em; }
.aff-narrow { max-width: 620px; }
.aff-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 4vw, 48px); align-items: start; }
@media (max-width: 860px) { .aff-two { grid-template-columns: 1fr; } }

.aff-hero { background: radial-gradient(120% 90% at 75% 40%, var(--night-2) 0%, var(--night) 60%); color: var(--on-night); padding: clamp(40px, 7vw, 90px) 0; }
.aff-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: center; }
.aff-hero h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); font-weight: 350; }
.aff-hero h1 em { color: var(--glow); }
.aff-hero-art { margin: 0; }
.aff-hero-art img { border-radius: var(--radius); }
@media (max-width: 860px) { .aff-hero-grid { grid-template-columns: 1fr; } }

.aff-steps { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: s; }
.aff-steps li { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); color: var(--muted); position: relative; }
.aff-steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--accent); color: #fff; font: italic 1.1rem var(--display); margin-bottom: 12px; }
.aff-steps strong { color: var(--ink); }
@media (max-width: 960px) { .aff-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .aff-steps { grid-template-columns: 1fr; } }

.aff-band { background: var(--tint); margin-top: clamp(40px, 6vw, 70px); padding: clamp(36px, 5vw, 60px) 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 1.2rem 0; }
.stat { background: var(--card); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.stat-num { font: italic 400 clamp(1.7rem, 3vw, 2.3rem)/1.05 var(--display); color: var(--accent); }
.stat-label { font-size: .95rem; color: var(--muted); }
.aff-list { padding-left: 1.2em; }
.aff-list li { margin-bottom: .4em; }
.aff-list li::marker { color: var(--accent); }
.aff-cta { text-align: center; padding-bottom: 20px; }

.aff-card { background: var(--card); border-radius: var(--radius); padding: clamp(20px, 3vw, 30px); box-shadow: var(--shadow); margin-bottom: 20px; }
.aff-card h2:first-child, .aff-card .h3:first-child { margin-top: 0; }
.aff-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 860px) { .aff-tools { grid-template-columns: 1fr; } }
.qr { background: #fff; border-radius: 8px; }
.qr-fig { display: flex; gap: 16px; align-items: center; margin: 16px 0 0; }
.qr-fig figcaption { max-width: 22em; }

/* Forms */
.form-panel { background: var(--card); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow); }
.aff-form { display: grid; gap: 16px; margin: 1rem 0; }
.aff-form .btn { justify-self: start; }
.aff-inline { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.aff-inline .btn { align-self: end; margin-bottom: 2px; }
.aff-inline-tight { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.aff-inline-tight input { font: 400 .95rem var(--body); padding: .5em .7em; border: 1.5px solid var(--rule); border-radius: 10px; background: var(--card); min-width: 180px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: .98rem; }
.field .req { font-weight: 400; font-size: .85rem; color: var(--muted); }
.hint { margin: 0; font-size: .92rem; color: var(--muted); }
.field input:not([type="checkbox"]), .field textarea, .field select, .copy-box input, .copy-box textarea {
  font: 400 1.02rem var(--body); padding: .65em .85em; border: 1.5px solid var(--rule); border-radius: 12px; background: var(--card); color: var(--ink); width: 100%; resize: vertical; min-height: 46px;
}
.field input:focus, .field textarea:focus, .field select:focus, .copy-box input:focus, .copy-box textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field-error input, .field-error textarea, .field-error select { border-color: #b3202c; }
.error-text { margin: 0; color: #9b1c26; font-weight: 600; font-size: .95rem; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 600 !important; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.aff-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 1rem 0; }

/* Notices and badges */
.notice { background: var(--card); border-left: 4px solid var(--accent); border-radius: 12px; padding: 14px 18px; margin: 1rem 0; box-shadow: var(--shadow); }
.notice p { margin: 0 0 .4em; } .notice p:last-child { margin: 0; }
.notice ul { margin: .4em 0 0; }
.notice-ok { border-left-color: #1d6b57; }
.notice-warn { border-left-color: #b4730f; }
.notice-error { border-left-color: #b3202c; }
.notice form { margin-top: 8px; }
.badge { display: inline-block; font: 700 .78rem/1 var(--body); letter-spacing: .04em; padding: .4em .7em; border-radius: 999px; background: var(--tint); color: var(--ink); vertical-align: middle; white-space: nowrap; }
.badge-approved, .badge-available, .badge-paid { background: #d8efe6; color: #12503f; }
.badge-pending, .badge-holding, .badge-queued { background: #f6e7c8; color: #6a4508; }
.badge-rejected, .badge-reversed, .badge-cancelled { background: #f4d6d6; color: #7d1a22; }
.badge-suspended { background: #e3e0da; color: #3d3a35; }

/* Tables */
.data { width: 100%; border-collapse: collapse; font-size: .98rem; background: var(--card); border-radius: 12px; overflow: hidden; }
.data th, .data td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.data thead th { font: 700 .76rem/1.4 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); background: var(--tint); }
.data tbody tr:last-child td { border-bottom: 0; }

/* Copy boxes and the ad gallery */
.copy-box { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: start; margin: 0 0 16px; }
.copy-box label, .copy-box .hint { grid-column: 1 / -1; }
.copy-box label { font-weight: 700; font-size: .98rem; }
.copy-box .btn { min-height: 46px; }
.copy-done { grid-column: 1 / -1; font-size: .9rem; color: #1d6b57; min-height: 1em; }
.ad-grid { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.ad-grid li { background: var(--card); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); display: grid; gap: 10px; align-content: start; }
.ad-grid img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--rule); }

.aff-terms h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-top: 1.4em; }
.aff-terms { max-width: 860px; }
.aff-footer { margin-top: 40px; padding: 26px 0; }

/* Affiliate code banner on store pages (js/ref.js) */
.ref-banner { background: var(--glow); color: var(--night); text-align: center; font-size: .95rem; padding: .5rem 16px; }
.ref-banner strong { letter-spacing: .06em; }
