/* =========================================================================
   Opquira — design system (build-free, hand-authored)
   Light-first, refined dark. No framework, no build step.
   ========================================================================= */

:root {
    color-scheme: light dark;

    --bg: #ffffff;
    --bg-subtle: #f6f8f7;
    --surface: #ffffff;
    --surface-2: #f3f5f4;
    --border: #e6e9e8;
    --border-strong: #d3d8d6;
    --text: #0f1413;
    --text-2: #3d4644;
    --muted: #697471;
    --brand: #0d9488;
    --brand-strong: #0f766e;
    --brand-ink: #ffffff;
    --accent-soft: #ecfdf8;
    --warn: #b45309;
    --danger: #dc2626;
    --ring: rgba(13, 148, 136, 0.22);

    --shadow-sm: 0 1px 2px rgba(16, 24, 22, 0.06);
    --shadow: 0 4px 16px -6px rgba(16, 24, 22, 0.14);
    --shadow-lg: 0 18px 48px -18px rgba(16, 24, 22, 0.28);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --maxw: 1120px;

    --step--1: 0.86rem;
    --step-0: 1rem;
    --step-1: 1.15rem;
    --step-2: 1.4rem;
    --step-3: 1.85rem;
    --step-4: 2.4rem;
    --step-5: 3.15rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0d0d;
        --bg-subtle: #101312;
        --surface: #141817;
        --surface-2: #191e1d;
        --border: #262c2b;
        --border-strong: #333b39;
        --text: #eef1f0;
        --text-2: #c1c8c6;
        --muted: #8b938f;
        --brand: #2dd4bf;
        --brand-strong: #5eead4;
        --brand-ink: #04302b;
        --accent-soft: #0e2a26;
        --warn: #f59e0b;
        --danger: #f87171;
        --ring: rgba(45, 212, 191, 0.28);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.6);
        --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    font-size: var(--step-0);
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.28; letter-spacing: -0.02em; margin: 0; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header / nav ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 64px; }
.brand {
    font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em;
    display: inline-flex; align-items: center; gap: 8px;
}
.brand::before {
    content: ""; width: 20px; height: 20px; border-radius: 6px;
    background: var(--brand);
    box-shadow: inset 0 0 0 3px var(--bg);
    outline: 2px solid var(--brand); outline-offset: -2px;
}
.site-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.site-nav a { padding: 8px 11px; border-radius: var(--radius-sm); color: var(--muted); font-size: 0.9rem; font-weight: 500; transition: color .15s, background .15s; }
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.nav-cta { color: var(--brand-ink) !important; background: var(--brand); font-weight: 600; }
.nav-cta:hover { background: var(--brand-strong) !important; color: var(--brand-ink) !important; }
.nav-logout { display: inline; margin: 0; }
.nav-logout button { background: none; border: none; cursor: pointer; font: inherit; padding: 8px 11px; border-radius: var(--radius-sm); color: var(--muted); }
.nav-logout button:hover { color: var(--text); background: var(--surface-2); }

/* ---------- Layout rhythm ---------- */
.main { display: block; }
.container.main { padding-top: 40px; padding-bottom: 72px; }
.section { margin-top: 56px; }
.section-head { margin-bottom: 20px; }
.section-title { font-size: var(--step-2); }
.section-title a:hover { color: var(--brand); }
.section-sub { color: var(--muted); margin: 6px 0 0; font-size: 0.96rem; }
.eyebrow {
    display: inline-block; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--brand-strong);
    background: var(--accent-soft); padding: 5px 11px; border-radius: 999px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: 10px; font-weight: 650; font-size: 0.95rem;
    border: 1px solid transparent; cursor: pointer; transition: transform .12s, background .15s, box-shadow .15s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-strong); box-shadow: var(--shadow); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { display: flex; width: 100%; }
.btn + .btn { margin-left: 10px; }

/* ---------- Hero ---------- */
.hero {
    position: relative; padding: 40px 0 8px; max-width: 780px;
}
.hero-eyebrow { margin-bottom: 20px; }
.hero-title { font-size: var(--step-5); line-height: 1.12; margin: 0 0 18px; font-weight: 820; letter-spacing: -0.035em; }
.hero-title .grad {
    background: linear-gradient(120deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #22d3ee));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { color: var(--text-2); font-size: 1.16rem; margin: 0 0 28px; max-width: 620px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-trust { margin-top: 22px; color: var(--muted); font-size: 0.86rem; display: flex; gap: 18px; flex-wrap: wrap; }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust span::before { content: "✓"; color: var(--brand); font-weight: 800; }
.hero-bg {
    position: absolute; inset: -80px -200px auto auto; width: 520px; height: 420px; z-index: -1;
    background: radial-gradient(closest-side, var(--ring), transparent 70%);
    filter: blur(10px); pointer-events: none;
}

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }
.card {
    position: relative; display: flex; flex-direction: column; gap: 7px;
    padding: 20px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow-sm);
}
a.card { transition: transform .16s, border-color .16s, box-shadow .16s; }
a.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); box-shadow: var(--shadow); }
.card-title { font-weight: 700; letter-spacing: -0.01em; font-size: 1.03rem; }
.card-desc { color: var(--muted); font-size: 0.92rem; }
.card-badge { position: absolute; top: 14px; right: 14px; font-size: 0.68rem; padding: 3px 9px; border-radius: 999px; font-weight: 700; letter-spacing: 0.02em; }
.badge-building { background: var(--accent-soft); color: var(--brand-strong); }
.badge-planned { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-live { background: var(--brand); color: var(--brand-ink); }

/* ---------- Feature list (icon rows) ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature-ic {
    flex: none; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
    background: var(--accent-soft); color: var(--brand-strong); font-size: 1.1rem; font-weight: 800;
    border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
}
.feature h3 { font-size: 1.02rem; margin-bottom: 3px; }
.feature p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* ---------- Band (alt background section) ---------- */
.band { background: var(--bg-subtle); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.band .container { padding-top: 56px; padding-bottom: 56px; }

/* ---------- FAQ (native details) ---------- */
.faq { display: grid; gap: 10px; max-width: 780px; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.faq summary { list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 650; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-weight: 800; font-size: 1.2rem; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 18px 16px; color: var(--muted); font-size: 0.95rem; }

/* ---------- CTA band ---------- */
.cta {
    text-align: center; padding: 48px 28px; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--brand-strong), var(--brand));
    color: var(--brand-ink); box-shadow: var(--shadow-lg);
}
.cta h2 { font-size: var(--step-3); margin-bottom: 10px; color: var(--brand-ink); }
.cta p { margin: 0 0 22px; opacity: 0.92; }
.cta .btn-ghost { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.cta .btn-ghost:hover { background: rgba(255, 255, 255, 0.24); }
.cta .btn-primary { background: #fff; color: var(--brand-strong); }

/* ---------- Page head / breadcrumbs ---------- */
.page-head { max-width: 760px; }
.page-title { font-size: var(--step-3); margin: 0 0 10px; }
.page-lead { color: var(--text-2); margin: 0; font-size: 1.05rem; }
.crumbs { font-size: 0.84rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { margin: 0 7px; opacity: 0.55; }
.crumbs [aria-current="page"] { color: var(--text-2); }

/* Compact bullet list (tool aside) */
.mini-list { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.9rem; }
.mini-list li { margin-bottom: 6px; }

/* ---------- Pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.price-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 24px; box-shadow: var(--shadow-sm); }
.price-card-featured { border-color: var(--brand); box-shadow: var(--shadow); }
.price-name { margin: 0 0 6px; font-size: 1.12rem; }
.price-amount { margin: 0 0 16px; font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; }
.price-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.92rem; }
.price-list li { margin-bottom: 7px; }
.price-note { color: var(--muted); font-size: 0.85rem; margin-top: 18px; }

/* ---------- Notice ---------- */
.notice { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 18px; color: var(--muted); background: var(--surface); }
.notice a { color: var(--brand); font-weight: 600; }

/* ---------- Data table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; background: var(--surface-2); }
.data-table tr:last-child td { border-bottom: none; }
.tag-chip { display: inline-block; font-size: 0.72rem; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--brand-strong); font-weight: 600; }
.tag-chip.chip-warn { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); color: var(--warn); }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 14px; }
.stat { display: flex; flex-direction: column; gap: 5px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-label { font-size: 0.8rem; color: var(--muted); }
.stat-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-accent { border-color: var(--brand); }
.stat-accent .stat-value { color: var(--brand-strong); }

/* ---------- Tool layout ---------- */
.tool-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.tool-form { display: flex; flex-direction: column; gap: 15px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.tool-aside { display: flex; flex-direction: column; gap: 14px; }
.tool-hint { color: var(--muted); font-size: 0.82rem; margin: 4px 0 0; }
.req { font-size: 0.68rem; color: var(--brand-strong); font-weight: 700; margin-left: 5px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 0.85rem; color: var(--text-2); font-weight: 600; }
.field input, .field select, .field textarea, .tool-form input[type="file"] {
    width: 100%; padding: 11px 13px; font: inherit; color: var(--text);
    background: var(--bg); border: 1px solid var(--border-strong); border-radius: 10px;
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring);
}
.check { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); }

/* ---------- Alerts ---------- */
.alert { border-radius: 10px; padding: 13px 15px; margin-bottom: 18px; font-size: 0.9rem; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { background: var(--accent-soft); color: var(--brand-strong); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.alert-error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 34%, transparent); }

/* ---------- Auth ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: var(--bg-subtle); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px 30px; box-shadow: var(--shadow-lg); }
.auth-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em; margin-bottom: 22px; }
.auth-brand::before { content: ""; width: 20px; height: 20px; border-radius: 6px; background: var(--brand); box-shadow: inset 0 0 0 3px var(--surface); outline: 2px solid var(--brand); outline-offset: -2px; }
.auth-title { font-size: 1.3rem; margin: 0 0 20px; }
.auth-note { color: var(--muted); font-size: 0.9rem; margin: 0 0 16px; }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 20px; font-size: 0.85rem; }
.auth-links a { color: var(--brand-strong); font-weight: 600; }
.auth-links a:hover { text-decoration: underline; }

/* ---------- Account settings ---------- */
.settings-block { max-width: 480px; }
.settings-form { display: flex; flex-direction: column; gap: 15px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.settings-form .btn { align-self: flex-start; }

/* ---------- Error pages ---------- */
.error-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg-subtle); }
.error-card { text-align: center; max-width: 440px; }
.error-code { font-size: 3.8rem; font-weight: 850; letter-spacing: -0.04em; color: var(--brand); line-height: 1.05; }
.error-message { color: var(--muted); margin: 10px 0 26px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-subtle); padding: 48px 0 36px; margin-top: 88px; color: var(--muted); }
.footer-cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; margin-bottom: 32px; }
.footer-cols h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin: 0 0 12px; }
.footer-cols a { display: block; padding: 4px 0; font-size: 0.9rem; color: var(--muted); }
.footer-cols a:hover { color: var(--brand); }
.footer-brand { font-weight: 800; color: var(--text); margin: 0 0 6px; font-size: 1.1rem; }
.footer-note { font-size: 0.86rem; margin: 0 0 8px; max-width: 30ch; }
.footer-copy { font-size: 0.8rem; margin: 0; padding-top: 20px; border-top: 1px solid var(--border); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .footer-cols { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 720px) {
    .tool-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    :root { --step-5: 2.4rem; --step-4: 2rem; --step-3: 1.6rem; }
    .container { padding: 0 18px; }
    .header-inner { height: auto; padding: 12px 0; flex-direction: column; align-items: flex-start; gap: 8px; }
    .hero { padding-top: 28px; }
    .footer-cols { grid-template-columns: 1fr; }
    .btn + .btn { margin-left: 0; }
}
