/* "Your Ag App" shell, styled to match the Verge marketing site (vergeag.com).
   Tokens sourced from the dev-site design system (dev-site/src/input.css).
   Swap these variables to try your own brand. */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Roboto:wght@400;500;700&display=swap');

:root {
    --brand-dark: #1e242d;
    --brand-accent: #b803fd;
    --brand-accent-dark: #9602d1;
    --brand-accent-pale: #f5e6ff;
    --brand-bg: #f9fafb;
    --brand-surface: #ffffff;
    --brand-border: #e5e7eb;
    --brand-text: #111827;
    --brand-text-muted: #6b7280;
    --ok: #16a34a;
    --warn: #d97706;
    --error: #dc2626;
    --header-height: 64px;
    --sidebar-width: 240px;
    --radius: 8px;
    font-size: 15px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: var(--brand-bg);
    color: var(--brand-text);
}

h1, h2, h3 {
    font-family: "Poppins", "Roboto", sans-serif;
    font-weight: 600;
}

/* ---------- Shell: fixed header + sidebar ---------- */

.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--brand-dark);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    z-index: 10;
}

.header .logo {
    font-family: "Poppins", "Roboto", sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.header .logo-mark {
    display: inline-block;
    width: 26px; height: 26px;
    border-radius: 6px;
    background: var(--brand-accent);
    color: #fff;
    text-align: center;
    line-height: 26px;
    font-weight: 800;
    margin-right: 8px;
}

.header .env {
    margin-left: auto;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.sidebar {
    position: fixed;
    top: var(--header-height); left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--brand-surface);
    border-right: 1px solid var(--brand-border);
    padding: 16px 0;
    display: flex;
    flex-direction: column;
}

.sidebar nav { flex: 1; }

.sidebar a {
    display: block;
    padding: 10px 20px;
    color: var(--brand-text);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar a:hover { background: var(--brand-bg); }

.sidebar a.active {
    border-left-color: var(--brand-accent);
    background: var(--brand-accent-pale);
    font-weight: 600;
}

/* ---------- Integration journey checklist (sidebar) ---------- */

.sidebar-journey {
    padding: 14px 12px 16px;
    border-top: 1px solid var(--brand-border);
}

.sidebar-journey h3 {
    margin: 0 8px 8px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-text-muted);
}

.journey {
    list-style: none;
    margin: 0;
    padding: 0;
}

.journey-item a {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 7px 8px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--brand-text);
}

.journey-item a:hover { background: var(--brand-bg); }

.journey-check {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border: 2px solid var(--brand-border);
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
    color: #fff;
}

.journey-item.done .journey-check {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
}

.journey-text { display: flex; flex-direction: column; }

.journey-label { font-size: 0.83rem; font-weight: 500; }

.journey-item.done .journey-label { color: var(--brand-text-muted); }

.journey-hint {
    font-size: 0.7rem;
    color: var(--brand-text-muted);
    font-family: ui-monospace, monospace;
}

.chip {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--brand-bg);
    border: 1px solid var(--brand-border);
    color: var(--brand-text-muted);
}

.chip-ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: var(--ok);
}

.chip-upcoming {
    background: var(--brand-accent-pale);
    border-color: #e9c8ff;
    color: var(--brand-accent-dark);
    font-weight: 600;
    white-space: nowrap;
}

main {
    margin: var(--header-height) 0 0 var(--sidebar-width);
    padding: 28px;
    max-width: 1100px;
}

/* ---------- Common elements ---------- */

h1 { margin-top: 0; font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
p, li { line-height: 1.55; }
a { color: var(--brand-accent); }

.card {
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.callout {
    border: 1px solid var(--brand-border);
    border-left: 4px solid var(--brand-accent);
    background: var(--brand-surface);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 0 0 16px;
}

.callout-warn { border-left-color: var(--warn); }

/* ---------- Objective blocks and step badges ---------- */

.objective {
    background: linear-gradient(135deg, var(--brand-accent-pale), var(--brand-surface) 55%);
    border: 1px solid #e9c8ff;
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 20px;
}

.objective h2 { margin: 0 0 8px; }

.objective-list { margin: 8px 0; padding-left: 22px; }
.objective-list li { margin-bottom: 6px; }

.step-badge {
    display: inline-block;
    width: 26px;
    height: 26px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--brand-accent);
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
    line-height: 26px;
    vertical-align: 2px;
}

.step-intro { color: var(--brand-text-muted); }

.btn {
    font: inherit;
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--brand-border);
    background: var(--brand-surface);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.btn:hover { background: var(--brand-bg); }
.btn:disabled { opacity: 0.5; cursor: default; }

.btn-primary {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    color: #fff;
}

.btn-primary:hover { background: var(--brand-accent-dark); }

.btn-ghost {
    border-color: transparent;
    color: var(--brand-accent);
    padding: 4px 8px;
}

input[type="password"], input[type="text"], select {
    font: inherit;
    padding: 8px 10px;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    min-width: 300px;
}

pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.8rem;
    line-height: 1.5;
}

code {
    background: var(--brand-bg);
    border: 1px solid var(--brand-border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.85em;
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.88rem;
}

th, td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--brand-border);
    vertical-align: top;
}

/* ---------- Wizard ---------- */

.wizard {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    counter-reset: step;
}

.wizard-step {
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: var(--brand-surface);
    padding: 14px 16px;
    margin-bottom: 12px;
    counter-increment: step;
}

.wizard-step-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.wizard-step-title::before {
    content: counter(step) ". ";
    color: var(--brand-text-muted);
}

.wizard-step-title { font-weight: 600; }

.wizard-why {
    margin: 0 0 8px;
    color: var(--brand-text-muted);
    font-size: 0.9rem;
}

.wizard-api { margin-bottom: 8px; }

.wizard-api summary {
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--brand-accent);
    user-select: none;
}

.wizard-api[open] summary { margin-bottom: 6px; }

.wizard-call {
    display: inline-block;
    margin-bottom: 8px;
}

.wizard-payload {
    max-height: 220px;
    overflow-y: auto;
    margin: 0 0 8px;
}

.wizard-result { font-size: 0.85rem; color: var(--brand-text-muted); }
.wizard-result.ok { color: var(--ok); }
.wizard-result.error { color: var(--error); }

/* ---------- Log panel ---------- */

.log-panel {
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: 24px;
}

.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.log-header h3 { margin: 0; }

.log-empty {
    color: var(--brand-text-muted);
    font-size: 0.88rem;
    padding: 12px 0;
}

.log-entries {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.log-entry { border-top: 1px solid var(--brand-border); }

.log-summary {
    font: inherit;
    display: grid;
    grid-template-columns: 80px 60px 1fr 55px 70px;
    gap: 8px;
    align-items: center;
    width: 100%;
    padding: 8px 4px;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
    font-size: 0.85rem;
}

.log-summary:hover { background: var(--brand-bg); }

.log-time { color: var(--brand-text-muted); }
.log-method { font-weight: 700; }
.log-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; }
.log-duration { color: var(--brand-text-muted); text-align: right; }

.log-status {
    font-weight: 700;
    text-align: center;
    border-radius: 4px;
    padding: 1px 0;
}

.status-ok { color: var(--ok); background: #f0fdf4; }
.status-warn { color: var(--warn); background: #fffbeb; }
.status-error { color: var(--error); background: #fef2f2; }

.log-detail { padding: 4px 8px 14px; }
.log-detail h4 { margin: 12px 0 4px; font-size: 0.8rem; color: var(--brand-text-muted); text-transform: uppercase; }
.log-detail pre { margin: 0; max-height: 260px; overflow-y: auto; }

/* ---------- Embedded iframe ---------- */

.embed-frame {
    width: 100%;
    height: 640px;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    background: var(--brand-surface);
}

.embed-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin: 12px 0;
}

.embed-controls label {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 0.88rem;
}

/* ---------- Mode cards on the home page ---------- */

.mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .mode-cards { grid-template-columns: 1fr; }
    main { padding: 16px; }
}

.mermaid { background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: var(--radius); padding: 12px; }
