/* ============================================================
   REFF TOOL — "Floodlit" Design System
   Barlow Condensed (headers) · DM Sans (body) · JetBrains Mono (data)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ── Core palette ── */
    --bg:           #f2ede6;   /* warm parchment */
    --surface:      #ffffff;
    --deep:         #09142a;   /* rich navy */
    --accent:       #00c853;   /* electric green */
    --accent-dark:  #009e3f;
    --amber:        #f59e0b;
    --danger:       #ef4444;

    /* ── Typography ── */
    --text:         #111827;
    --muted:        #6b7280;

    /* ── Borders ── */
    --border:       #e2d9ce;   /* warm, not cool-gray */

    /* ── Shadows ── */
    --shadow-sm:    0 1px 3px rgba(9,20,42,0.07), 0 4px 16px rgba(9,20,42,0.04);
    --shadow-md:    0 4px 12px rgba(9,20,42,0.11), 0 8px 32px rgba(9,20,42,0.07);

    /* ── Legacy aliases (so pages referencing old vars still compile) ── */
    --primary-color:   #09142a;
    --accent-color:    #00c853;
    --secondary-color: #09142a;
    --highlight-color: #0f1f3d;
    --success-color:   #00c853;
    --warning-color:   #f59e0b;
    --danger-color:    #ef4444;
    --light-bg:        #f2ede6;
    --white:           #ffffff;
    --text-dark:       #111827;
    --text-light:      #6b7280;
    --border-color:    #e2d9ce;
    --shadow:          var(--shadow-sm);
    --shadow-hover:    var(--shadow-md);
}

/* ============================================================
   Base
   ============================================================ */

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.65;
    color: var(--text);
    /* Deep navy with subtle diagonal field-line texture */
    background-color: var(--deep);
    background-image:
        repeating-linear-gradient(
            15deg,
            transparent,
            transparent 56px,
            rgba(255,255,255,0.016) 56px,
            rgba(255,255,255,0.016) 58px
        );
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.48), 0 4px 16px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* ── Page-load stagger ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card, fieldset, .info-section {
    animation: fadeUp 0.3s ease both;
}

.card:nth-child(2)  { animation-delay: 0.05s; }
.card:nth-child(3)  { animation-delay: 0.10s; }
.card:nth-child(4)  { animation-delay: 0.15s; }

/* ============================================================
   Header
   ============================================================ */

header {
    background: var(--deep);
    color: #fff;
    text-align: center;
    padding: 36px 48px 30px;
    position: relative;
    overflow: hidden;
}

/* Faint vertical pitch lines */
header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 70px,
        rgba(255,255,255,0.025) 70px,
        rgba(255,255,255,0.025) 72px
    );
    pointer-events: none;
}

/* Electric-green left edge stripe — the signature mark */
header::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: var(--accent);
    border-radius: 0;
}

header h1 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #fff;
    margin-bottom: 6px;
    position: relative;
    text-transform: uppercase;
    line-height: 1;
}

header .subtitle {
    color: rgba(255,255,255,0.55);
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    position: relative;
}

/* ============================================================
   Main Content
   ============================================================ */

main {
    padding: 32px 28px;
    background: var(--bg);
}

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    letter-spacing: 0.3px;
    line-height: 1.1;
}

h1 { font-size: 2.4rem; color: var(--deep); margin-bottom: 10px; }
h2 { font-size: 1.85rem; color: var(--deep); margin-bottom: 12px; }
h3 { font-size: 1.35rem; color: var(--deep); margin-bottom: 8px; }

.subtitle {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 20px;
}

/* Data / codes rendered in mono */
.mono, code,
[class*="game-num"], [class*="game-code"] {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.82em;
    background: rgba(9,20,42,0.06);
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

/* ============================================================
   Cards & Grid
   ============================================================ */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-icon { font-size: 2.2rem; margin-bottom: 12px; display: block; }
.card h2   { font-size: 1.35rem; margin-bottom: 8px; }
.card p    { color: var(--muted); margin-bottom: 16px; font-size: 0.9rem; line-height: 1.55; }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-block;
    padding: 10px 22px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
    letter-spacing: 0.2px;
    line-height: 1.4;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

/* Primary — deep navy */
.btn-primary {
    background: var(--deep);
    color: #fff;
    border-color: var(--deep);
    box-shadow: 0 2px 8px rgba(9,20,42,0.18);
}

.btn-primary:hover:not(:disabled) {
    background: #0f1f3d;
    box-shadow: 0 4px 16px rgba(9,20,42,0.28);
}

/* Secondary — electric green */
.btn-secondary {
    background: var(--accent);
    color: var(--deep);
    border-color: var(--accent);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,200,83,0.18);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--accent-dark);
    color: #fff;
    border-color: var(--accent-dark);
    box-shadow: 0 4px 16px rgba(0,200,83,0.28);
}

/* Outline — ghost */
.btn-outline {
    background: transparent;
    color: var(--deep);
    border-color: var(--border);
}

.btn-outline:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--deep);
    box-shadow: var(--shadow-sm);
}

.btn-large  { padding: 13px 36px; font-size: 0.95rem; }
.btn-group  { display: flex; gap: 10px; flex-wrap: wrap; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ============================================================
   Forms
   ============================================================ */

.form-container { max-width: 800px; margin: 0 auto; }

fieldset {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 26px;
    margin-bottom: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    position: relative;
}

fieldset::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--accent);
    border-radius: 12px 0 0 12px;
}

legend {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--deep);
    padding: 0 10px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.form-group { margin-bottom: 18px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 0.85rem;
    letter-spacing: 0.2px;
}

.required { color: var(--amber); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'DM Sans', sans-serif;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    background: #faf9f7;
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(0,200,83,0.11);
}

textarea { resize: vertical; }

small {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    padding: 9px 12px;
    border-radius: 8px;
    transition: border-color 0.15s, background 0.15s;
    border: 1.5px solid var(--border);
    background: #faf9f7;
    font-size: 0.86rem;
}

.checkbox-group label:hover {
    background: var(--surface);
    border-color: var(--accent);
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--accent);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
    padding: 16px 0;
}

/* ============================================================
   Day Rows
   ============================================================ */

.day-row {
    border-left: 4px solid var(--accent) !important;
    border-radius: 8px;
    background: #faf9f7 !important;
}

/* ============================================================
   Messages & Alerts
   ============================================================ */

.form-message {
    padding: 12px 18px;
    border-radius: 8px;
    margin-top: 18px;
    font-weight: 500;
    font-size: 0.88rem;
}

.form-message.success {
    background: #d5f5e3;
    color: #0a4d2a;
    border: 1.5px solid #a9dfbf;
}

.form-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1.5px solid #fca5a5;
}

.form-message.warning {
    background: #fef3c7;
    color: #78350f;
    border: 1.5px solid #fde68a;
}

.status-banner {
    background: var(--deep);
    color: #fff;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 26px;
    text-align: center;
    border-left: 4px solid var(--accent);
}

.status-banner h3  { color: #fff; margin-bottom: 6px; font-family: 'Barlow Condensed', sans-serif; }
.status-detail     { font-size: 0.86rem; opacity: 0.75; }

/* ============================================================
   Lists & Links
   ============================================================ */

.link-list { list-style: none; padding: 0; }
.link-list li { margin-bottom: 10px; }

.link-list a {
    color: var(--deep);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.15s;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1px;
}

.link-list a:hover {
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
}

.help-text { font-size: 0.86rem; color: var(--muted); margin-top: 8px; }

/* ============================================================
   Info Section & Steps
   ============================================================ */

.info-section {
    margin: 32px 0;
    padding: 24px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.step {
    background: var(--bg);
    padding: 18px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--deep);
    color: var(--accent);
    border-radius: 50%;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.step h3 { font-size: 1.1rem; margin-bottom: 6px; }
.step p  { color: var(--muted); font-size: 0.86rem; }

/* ============================================================
   Help Section
   ============================================================ */

.help-section {
    background: #fffbeb;
    border-left: 4px solid var(--amber);
    padding: 18px 20px;
    margin-top: 28px;
    border-radius: 8px;
}

.help-section h3  { color: #92400e; margin-bottom: 8px; font-size: 1.1rem; }
.help-section ul  { margin-left: 18px; margin-top: 8px; }
.help-section li  { margin-bottom: 6px; font-size: 0.88rem; }

/* ============================================================
   Footer
   ============================================================ */

footer {
    text-align: center;
    padding: 20px 28px;
    background: var(--deep);
    color: rgba(255,255,255,0.4);
    font-size: 0.82rem;
}

.footer-links { margin-top: 8px; }

.footer-links a {
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.15s;
    font-size: 0.82rem;
}

.footer-links a:hover { color: var(--accent); }

/* ============================================================
   Loading Spinner
   ============================================================ */

.spinner {
    display: inline-block;
    width: 17px;
    height: 17px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
    body           { padding: 10px; }
    header         { padding: 24px 20px 20px; }
    header h1      { font-size: 2rem; }
    main           { padding: 20px 16px; }
    .form-row      { grid-template-columns: 1fr; }
    .checkbox-group { grid-template-columns: 1fr 1fr; }
    .steps         { grid-template-columns: 1fr; }
    .btn-group     { flex-direction: column; }
    .form-actions  { flex-direction: column; }
    .btn           { width: 100%; }
}

@media (max-width: 480px) {
    header h1   { font-size: 1.7rem; }
    .card       { padding: 16px; }
    fieldset    { padding: 16px; }
    .checkbox-group { grid-template-columns: 1fr; }
}

/* ============================================================
   Print
   ============================================================ */

@media print {
    body       { background: white; padding: 0; }
    .container { box-shadow: none; border-radius: 0; }
    .btn, .form-actions { display: none; }
}
