/* =====================================================================
   BuildPro — base: tokens, reset, typography, controls
   ===================================================================== */

:root {
    /* Navy / charcoal */
    --navy-950: #060c17;
    --navy-900: #0a1322;
    --navy-850: #0d1829;
    --navy-800: #122036;
    --navy-700: #1a2b44;
    --navy-600: #253a59;
    --line-dark: rgba(150, 172, 206, 0.14);
    --line-dark-2: rgba(150, 172, 206, 0.24);

    /* Steel neutrals */
    --steel-500: #6a7e98;
    --steel-400: #8fa1b8;
    --steel-300: #b6c3d5;
    --steel-200: #d7dfea;

    /* Restrained metallic blue accent */
    --accent: #3f78d6;
    --accent-600: #3265bb;
    --accent-300: #8db2ec;
    --accent-100: #e7eefb;
    --accent-050: #f3f7fd;
    --blueprint: #7fb0e4;

    /* Ink & paper */
    --ink: #0b1423;
    --ink-2: #334158;
    --ink-3: #5a677c;
    --ink-4: #8591a4;
    --paper: #ffffff;
    --paper-2: #f6f8fb;
    --paper-3: #edf1f6;
    --line: #e1e6ee;
    --line-2: #cbd4e0;

    /* Semantic */
    --success: #1b7f57;
    --success-bg: #e8f5ef;
    --warn: #9a6512;
    --warn-bg: #fdf4e3;
    --danger: #bf3636;
    --danger-600: #a52c2c;
    --danger-bg: #fcecec;
    --info-bg: #eaf1fc;

    --font-display: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 10px 30px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 20px 50px rgba(6, 12, 23, 0.28);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-600); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; }
code, kbd, pre { font-family: var(--font-mono); }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Accessibility ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 12px; top: -48px; z-index: 1000;
    padding: 10px 14px; background: var(--accent); color: #fff; border-radius: var(--radius);
    transition: top 0.15s;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Utilities ---------- */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: 0; }
.muted { color: var(--ink-4); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.icon { width: 18px; height: 18px; flex: none; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--font-mono); font-size: 12px; font-weight: 500;
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.eyebrow--light { color: var(--accent-300); }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; }
.brand:hover { color: inherit; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__frame { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: 0.55; }
.brand__top { fill: var(--accent); }
.brand__side { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.brand__edge { stroke: currentColor; stroke-width: 1.4; }
.brand__word { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: 0.14em; }
.brand__word b { font-weight: 800; color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
    --btn-bg: var(--paper); --btn-fg: var(--ink); --btn-bd: var(--line-2);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 0 16px;
    font-family: var(--font-sans); font-size: 14px; font-weight: 600; letter-spacing: 0.01em; line-height: 1;
    color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-bd); border-radius: var(--radius);
    text-decoration: none; white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover { color: var(--btn-fg); }
.btn .icon { width: 16px; height: 16px; }
.btn--primary { --btn-bg: var(--accent); --btn-fg: #fff; --btn-bd: var(--accent); }
.btn--primary:hover { --btn-bg: var(--accent-600); --btn-bd: var(--accent-600); }
.btn--ghost:hover { --btn-bg: var(--paper-2); --btn-bd: var(--steel-300); }
.btn--danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bd: var(--danger); }
.btn--danger:hover { --btn-bg: var(--danger-600); --btn-bd: var(--danger-600); }
.btn--outline-light { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, 0.32); }
.btn--outline-light:hover { --btn-bg: rgba(255, 255, 255, 0.07); --btn-bd: rgba(255, 255, 255, 0.55); }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn--lg { min-height: 48px; padding: 0 22px; font-size: 15px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: 0.55; pointer-events: none; }
.btn.is-static { pointer-events: none; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; animation: spin 0.7s linear infinite;
}
.btn--ghost.is-loading::after { border-color: var(--line-2); border-top-color: var(--ink-2); }
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 500; }
.link-btn:hover { color: var(--accent-600); text-decoration: underline; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.link-arrow .icon { width: 14px; height: 14px; transition: transform 0.15s; }
.link-arrow:hover .icon { transform: translateX(2px); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .field__row > label {
    font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field__aside { font-size: 13px; font-weight: 500; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.req { color: var(--danger); }
.opt { margin-left: 4px; font-weight: 400; color: var(--ink-4); font-size: 12px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="tel"], input[type="date"], input[type="url"], select, textarea {
    width: 100%; min-height: 42px; padding: 9px 12px;
    font-size: 14.5px; color: var(--ink);
    background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius);
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none; -webkit-appearance: none;
}
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
select {
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a677c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:hover, select:hover, textarea:hover { border-color: var(--steel-400); }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63, 120, 214, 0.16);
}
[aria-invalid="true"] { border-color: var(--danger) !important; }
[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(191, 54, 54, 0.14) !important; }
.field__hint { font-size: 12.5px; color: var(--ink-3); }
.field__error { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--danger); }
.field__error .icon { width: 14px; height: 14px; margin-top: 2px; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input {
    appearance: none; -webkit-appearance: none; flex: none;
    width: 18px; height: 18px; margin: 1px 0 0; border: 1px solid var(--line-2); border-radius: 3px; background: var(--paper);
    display: grid; place-content: center; cursor: pointer;
}
.check input::before {
    content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform 0.12s;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); background: #fff;
}
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::before { transform: scale(1); }

.password-input { position: relative; }
.password-input input { padding-right: 64px; }
.password-input__toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    padding: 4px 8px; font-size: 12px; font-weight: 600; color: var(--ink-3);
    background: none; border: 0; border-radius: 3px;
}
.password-input__toggle:hover { color: var(--ink); background: var(--paper-3); }

/* ---------- Alerts / badges / status ---------- */
.alert {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
    font-size: 14px; border: 1px solid; border-radius: var(--radius); line-height: 1.45;
}
.alert .icon { margin-top: 1px; }
.alert--error { color: #8e2424; background: var(--danger-bg); border-color: #f3c9c9; }
.alert--success { color: #145f41; background: var(--success-bg); border-color: #bfe3d2; }
.alert--info { color: #214a8a; background: var(--info-bg); border-color: #c9daf4; }

.badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px;
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
    border-radius: 3px; border: 1px solid var(--line-2); color: var(--ink-3); background: var(--paper);
    white-space: nowrap;
}
.badge--demo { color: #7a4d00; background: #fff4de; border-color: #f0d49e; }

.status {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--steel-300); }
.status--ok, .status--active, .status--completed { color: var(--success); }
.status--ok::before, .status--active::before { background: var(--success); }
.status--completed::before { background: var(--success); box-shadow: 0 0 0 2px var(--success-bg); }
.status--progress, .status--on_hold { color: var(--warn); }
.status--progress::before, .status--on_hold::before { background: #d89b2b; }
.status--archived { color: var(--ink-4); }

.tag {
    display: inline-block; padding: 1px 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 3px;
}

kbd {
    display: inline-block; min-width: 20px; padding: 1px 6px; font-size: 11px; line-height: 1.5; text-align: center;
    color: var(--ink-3); background: var(--paper-2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 3px;
}

/* ---------- Plan drawings (shared by homepage + auth) ---------- */
.plan { width: 100%; height: auto; }
.plan .pl-wall { stroke: var(--plan-wall); stroke-linecap: square; }
.plan .pl-wall-ext { fill: none; }
.plan .pl-room, .plan .pl-cut { fill: var(--plan-room); }
.plan .pl-jamb { stroke: var(--plan-wall); stroke-width: 1.2; }
.plan .pl-win { stroke: var(--plan-line); stroke-width: 1; }
.plan .pl-glass { stroke: var(--plan-accent); stroke-width: 1.4; }
.plan .pl-door { stroke: var(--plan-line); stroke-width: 1.3; }
.plan .pl-swing { fill: none; stroke: var(--plan-line); stroke-width: 0.9; stroke-dasharray: 3 2.5; }
.plan .pl-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; fill: var(--plan-text); }
.plan .pl-area { font-family: var(--font-mono); font-size: 9px; fill: var(--plan-muted); }
.plan .pl-dim, .plan .pl-ext { stroke: var(--plan-dim); stroke-width: 0.8; }
.plan .pl-tick { stroke: var(--plan-dim); stroke-width: 1.3; }
.plan .pl-dimtext { font-family: var(--font-mono); font-size: 9px; fill: var(--plan-dim-text); }

.plan--dark {
    --plan-room: #0f1d31; --plan-wall: #d5e0ee; --plan-line: #9fb4cf; --plan-accent: #7fb0e4;
    --plan-text: #c9d6e7; --plan-muted: #7890ae; --plan-dim: #5d7ba3; --plan-dim-text: #8faed4;
}
.plan--light {
    --plan-room: #ffffff; --plan-wall: #16233a; --plan-line: #4b5a72; --plan-accent: #3f78d6;
    --plan-text: #22314a; --plan-muted: #6a7890; --plan-dim: #3f78d6; --plan-dim-text: #2b5bab;
}
