/* Customer-facing portal theme -- deliberately separate from the admin
   console's dark/technical style.css. This is the product a non-technical
   customer sees, so it aims for a calm, trustworthy, "consumer app" feel
   instead of a developer-tool aesthetic. Reuses the same class names as
   style.css (card, badge, form-grid, etc.) so templates don't need to change,
   just the visual language behind them. */

:root {
    --bg: #f6f8fb;
    --panel: #ffffff;
    --border: #e2e8f0;
    --text: #1e2733;
    --muted: #64748b;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #b45309;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

.topnav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.9rem 1.5rem;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}
.topnav a { color: var(--text); text-decoration: none; }
.topnav .brand {
    font-weight: 700; margin-right: auto; font-size: 1.1rem; color: var(--accent-dark);
    display: flex; align-items: center; gap: 0.5rem;
}
.topnav .brand::before {
    content: "\2713";
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.6rem; height: 1.6rem; border-radius: 50%;
    background: var(--accent); color: white; font-size: 0.9rem; font-weight: 700;
}
.topnav .logout { color: var(--muted); }
.topnav .logout:hover { color: var(--text); }

.container { max-width: 760px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

.page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.page-header a { color: var(--accent); text-decoration: none; font-size: 0.9rem; }

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    margin: 1.25rem 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.card h2 { margin-top: 0; }

/* "How this works" step list -- visually distinct from ordinary bullet lists,
   since it's the very first thing a non-technical customer reads. */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 0.9rem; }
.steps li {
    display: flex; gap: 0.85rem; align-items: flex-start; counter-increment: step;
}
.steps li::before {
    content: counter(step);
    flex: 0 0 auto; width: 1.6rem; height: 1.6rem; border-radius: 50%;
    background: var(--accent); color: white; font-size: 0.85rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; margin-top: 0.1rem;
}

.form-grid { display: grid; grid-template-columns: 1fr; gap: 0.4rem 0.75rem; }
.form-grid label { margin-top: 0.6rem; font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.form-grid input, .form-grid textarea, .form-grid select {
    background: var(--panel); color: var(--text); border: 1px solid var(--border);
    border-radius: 8px; padding: 0.6rem 0.7rem; font-size: 0.95rem;
}
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus {
    outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.form-grid button { margin-top: 0.85rem; }

.inline-form { display: inline-flex; gap: 0.5rem; align-items: center; margin: 0.35rem 0.35rem 0.35rem 0; flex-wrap: wrap; }
.url-input {
    display: block; width: 100%; box-sizing: border-box;
    background: var(--panel); color: var(--text); border: 1px solid var(--border);
    border-radius: 8px; padding: 0.6rem 0.7rem; font-size: 0.95rem; margin-bottom: 0.5rem;
}
.url-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.eligibility-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin: 0.5rem 0; }
.eligibility-form label { display: flex; flex-direction: column; font-size: 0.8rem; color: var(--muted); gap: 0.2rem; }

button, .button {
    background: var(--accent); color: white; border: none; border-radius: 8px;
    padding: 0.55rem 1rem; cursor: pointer; font-size: 0.9rem; font-weight: 600;
    text-decoration: none; display: inline-block; transition: background 0.15s ease;
}
button:hover, .button:hover { background: var(--accent-dark); }
button.danger { background: var(--danger); }
button[type="button"] {
    background: var(--panel); color: var(--text); border: 1px solid var(--border);
}
button[type="button"]:hover { background: #f1f5f9; }

.flash { padding: 0.85rem 1.1rem; border-radius: 10px; margin-bottom: 1.25rem; font-weight: 500; }
.flash-success { background: #f0fdf4; border: 1px solid var(--success); color: #14532d; }
.flash-error { background: #fef2f2; border: 1px solid var(--danger); color: #7f1d1d; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.empty-state { color: var(--muted); font-style: italic; }

.badge {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px;
    background: #eef2f7; color: var(--muted); font-size: 0.72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.02em;
}
.badge-warning { background: #fef3e2; color: var(--warning); }
.badge-success { background: #eafaf0; color: var(--success); }
.badge-unwanted, .badge-negative { background: #fdecec; color: var(--danger); }
.badge-resolved, .badge-positive { background: #eafaf0; color: var(--success); }

.action-bar { display: flex; gap: 0.75rem; margin: 1rem 0; flex-wrap: wrap; }

.mention { border-top: 1px solid var(--border); padding: 1rem 0; }
.mention-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.mention-head a { color: var(--accent-dark); font-weight: 600; text-decoration: none; }
.mention-head a:hover { text-decoration: underline; }
.snippet { color: var(--muted); font-size: 0.9rem; }
.classification { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem; margin-top: 0.6rem; }
.action-row { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem; margin-top: 0.6rem; }

.code-block {
    background: #f8fafc; border: 1px solid var(--border); border-radius: 8px;
    padding: 0.85rem; white-space: pre-wrap; word-break: break-word; font-size: 0.85rem;
    color: #334155; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.subnav { display: flex; gap: 1rem; margin-bottom: 1rem; }
.subnav a { color: var(--accent); text-decoration: none; }

.row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.walkthrough { padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.45rem; color: var(--text); }
.walkthrough li { padding-left: 0.25rem; }

details summary { cursor: pointer; color: var(--accent-dark); font-weight: 600; }
