/* RightInvoice theme. Deep-blue brand on a cool paper background, ink-navy
   chrome (header/footer), generous whitespace, card-based surfaces.
   Self-contained (no external fonts/CDNs) for the AssetMapper no-build
   pipeline; font stacks resolve to high-quality system faces. */

:root {
    --brand: #2563b0;
    --brand-600: #1e549a;
    --brand-700: #184683;
    --brand-100: #dbe8f7;
    --brand-050: #eef4fb;
    --accent: #e8a33d;          /* warm counterpoint: highlights, focus rings */
    --ink: #1d2733;             /* header/footer chrome */
    --ink-800: #27333f;
    --bg: #f4f6f9;
    --surface: #ffffff;
    --border: #e3e8ef;
    --border-strong: #cdd5e0;
    --text: #3f4a57;
    --heading: #1d2733;
    --muted: #7d8894;
    --success-bg: #eaf7ee; --success-fg: #2e7d43; --success-bd: #c6e6cf;
    --warning-bg: #fdf3e3; --warning-fg: #8a5a10; --warning-bd: #f2d9a8;
    --error-bg: #fdecec;   --error-fg: #b83226;   --error-bd: #f2b8b8;
    --info-bg: #e9f2f8;    --info-fg: #2a6d8c;    --info-bd: #c3dcea;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(29, 39, 51, .05), 0 2px 8px rgba(29, 39, 51, .06);
    --shadow-lift: 0 4px 10px rgba(29, 39, 51, .08), 0 12px 32px rgba(29, 39, 51, .10);
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-head: "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    --page-max: 1080px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --brand: #6ba3e8; --brand-600: #85b4ec; --brand-700: #9fc4f0;
        --brand-100: #1d3552; --brand-050: #182a41;
        --accent: #e8b35d;
        --ink: #10161d; --ink-800: #161e27;
        --bg: #12161c; --surface: #1a2029; --border: #2a323d; --border-strong: #3a4450;
        --text: #ccd4dd; --heading: #e8edf3; --muted: #8f9aa6;
        --success-bg: #16301f; --success-fg: #7fd6a0; --success-bd: #244d33;
        --warning-bg: #33280f; --warning-fg: #e6bd76; --warning-bd: #55451f;
        --error-bg: #341a1a; --error-fg: #eba0a0; --error-bd: #593030;
        --info-bg: #16283a; --info-fg: #7fb8d6; --info-bd: #24455e;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .3);
        --shadow-lift: 0 4px 10px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .4);
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15.5px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); text-decoration: underline; }

/* ---------- Chrome: header / footer ---------- */

.site-header {
    background: var(--ink);
    border-bottom: 3px solid var(--brand);
}
.site-header .bar {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
}
.brand {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.35rem;
    color: #fff;
    letter-spacing: .01em;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.brand::before {
    content: "";
    width: 26px; height: 26px;
    border-radius: 7px;
    background:
        linear-gradient(0deg, transparent 0, transparent 100%) ,
        var(--brand);
    background-image:
        linear-gradient(#ffffffcc 0 0), linear-gradient(#ffffffcc 0 0), linear-gradient(#ffffff88 0 0);
    background-size: 12px 2px, 12px 2px, 8px 2px;
    background-position: 7px 8px, 7px 13px, 7px 18px;
    background-repeat: no-repeat;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.brand:hover { color: #fff; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: flex-end; font-size: .95rem; }
.site-nav a {
    color: rgba(255, 255, 255, .78);
    white-space: nowrap;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
}
.site-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); text-decoration: none; }
.site-nav a.btn {
    background: var(--brand); color: #fff; border: none;
    padding: 8px 18px; margin-left: 6px;
}
.site-nav a.btn:hover { background: var(--brand-600); }

.impersonation-bar {
    background: var(--warning-bg); color: var(--warning-fg);
    border-bottom: 1px solid var(--warning-bd);
    text-align: center; padding: 8px 20px; font-size: .9rem;
}
.impersonation-bar a { color: var(--warning-fg); text-decoration: underline; font-weight: 600; }

.site-footer {
    border-top: 3px solid var(--brand);
    background: var(--ink);
    margin-top: 56px;
}
.site-footer .bar {
    max-width: var(--page-max); margin: 0 auto; padding: 30px 24px;
    display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center;
    color: #98a2ae; font-size: .9rem;
}
.site-footer nav { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.site-footer nav a { color: #cfd6dd; }
.site-footer nav a:hover { color: #fff; text-decoration: none; }

/* ---------- Layout ---------- */

main.container {
    max-width: var(--page-max);
    width: 100%;
    margin: 36px auto 0;
    padding: 0 24px 64px;
    flex: 1;
}

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--heading); font-weight: 600; }
h1 { font-size: 1.85rem; line-height: 1.2; margin: .2em 0 .7em; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; margin: 1.5em 0 .5em; }
h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; }
small, .muted { color: var(--muted); }

.page-header {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 10px 16px; margin: 0 0 20px;
}
.page-header h1 { margin: 0; }
.page-header .btn { margin: 0; }

.page-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
    margin: 0 0 18px; font-size: .95rem;
}

/* ---------- Cards ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 28px;
    margin: 0 0 20px;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card.narrow { max-width: 460px; }

/* Centered single-purpose card (login, signup, reset) */
.auth-wrap { display: flex; justify-content: center; padding: 24px 0; }
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
    padding: 34px 36px 30px;
    width: 100%;
    max-width: 420px;
}
.auth-card h1 { font-size: 1.45rem; margin: 0 0 18px; text-align: center; }
.auth-card .muted { text-align: center; display: block; margin-top: 18px; font-size: .92rem; }
.auth-card button[type="submit"] { width: 100%; margin-top: 6px; }

/* ---------- Forms ---------- */

form div { margin-bottom: 14px; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 5px; color: var(--heading); }
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="date"], input[type="file"], textarea, select {
    width: 100%;
    padding: 9px 12px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color .12s, box-shadow .12s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-100);
}
input[type="checkbox"] { width: auto; accent-color: var(--brand); }
textarea { min-height: 92px; resize: vertical; }

/* checkbox rows render label AFTER input in Symfony's div layout */
form div:has(> input[type="checkbox"]) { display: flex; align-items: center; gap: 8px; }
form div:has(> input[type="checkbox"]) label { margin: 0; font-weight: 500; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0 22px;
}

ul.form-errors, form ul {
    color: var(--error-fg);
    font-size: .88rem;
    margin: 4px 0 0;
    padding-left: 18px;
    list-style: disc;
}

button, input[type="submit"], .btn {
    display: inline-block;
    font: inherit;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .95rem;
    padding: 9px 20px;
    color: #fff;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .12s, border-color .12s, box-shadow .12s;
}
button:hover, input[type="submit"]:hover, .btn:hover {
    background: var(--brand-600); border-color: var(--brand-600);
    color: #fff; text-decoration: none;
    box-shadow: var(--shadow);
}
button:active, .btn:active { background: var(--brand-700); border-color: var(--brand-700); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--brand-050); color: var(--brand-700); border-color: var(--brand); box-shadow: none; }
.btn-lg { padding: 13px 30px; font-size: 1.05rem; border-radius: 8px; }
.btn-danger { background: transparent; color: var(--error-fg); border-color: var(--error-bd); }
.btn-danger:hover { background: var(--error-bg); border-color: var(--error-fg); color: var(--error-fg); box-shadow: none; }

/* Quiet inline actions (delete buttons inside tables etc.) */
.link-button {
    background: none; border: none; padding: 0; font: inherit; font-size: .92rem;
    color: var(--brand); cursor: pointer; font-weight: 500;
}
.link-button:hover { background: none; border: none; color: var(--brand-600); text-decoration: underline; box-shadow: none; }
td .link-button, .inline-form .link-button { color: var(--error-fg); }
td .link-button:hover { color: var(--error-fg); }

.inline-form { display: inline; margin: 0; }
.inline-form input[type="text"] { width: auto; }

/* ---------- Tables ---------- */

table.listing {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; margin: 8px 0 20px;
    box-shadow: var(--shadow);
}
table.listing th, table.listing td {
    text-align: left; padding: 12px 16px;
    border-bottom: 1px solid var(--border); vertical-align: middle;
}
table.listing th {
    background: var(--brand-050); color: var(--heading);
    font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
}
table.listing tbody tr:hover td { background: var(--brand-050); }
table.listing tr:last-child td { border-bottom: none; }
table.listing td form { display: inline; margin: 0 0 0 8px; }
table.listing td a + form { margin-left: 10px; }

.badge {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    font-size: .78rem; font-weight: 600; line-height: 1.6;
}
.badge-public { background: var(--success-bg); color: var(--success-fg); }
.badge-private { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

.empty-state {
    background: var(--surface); border: 1px dashed var(--border-strong);
    border-radius: var(--radius); padding: 44px 24px; text-align: center;
    color: var(--muted); margin: 8px 0 20px;
}
.empty-state p { margin: 0 0 14px; }

/* ---------- Alerts ---------- */

.alert { padding: 11px 15px; border-radius: var(--radius-sm); border: 1px solid; margin: 0 0 16px; font-size: .95rem; }
.alert-success { background: var(--success-bg); color: var(--success-fg); border-color: var(--success-bd); }
.alert-warning { background: var(--warning-bg); color: var(--warning-fg); border-color: var(--warning-bd); }
.alert-error   { background: var(--error-bg);   color: var(--error-fg);   border-color: var(--error-bd); }
.alert-info    { background: var(--info-bg);    color: var(--info-fg);    border-color: var(--info-bd); }

/* ---------- Invoice line-item editor ---------- */

.items-editor {
    width: 100%; border-collapse: collapse; margin: 4px 0 8px;
}
.items-editor th {
    text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); padding: 4px 10px 8px 0; font-weight: 700;
}
.items-editor td { padding: 4px 10px 4px 0; vertical-align: top; }
.items-editor td:nth-child(1) { width: 90px; }
.items-editor td:nth-child(3), .items-editor td:nth-child(4) { width: 110px; }
.items-editor td:last-child { width: 60px; padding-top: 12px; }
.items-editor textarea { min-height: 42px; }

/* ---------- The invoice document ---------- */

.document-frame {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
    overflow: hidden;
    margin: 0 0 24px;
}
#invoice a { text-decoration: none; }

/* ---------- Marketing: hero, features, plans, prose ---------- */

.hero {
    text-align: center;
    color: #fff;
    background:
        radial-gradient(80% 120% at 85% -10%, rgba(232, 163, 61, .25) 0%, transparent 55%),
        linear-gradient(118deg, var(--ink-800) 0%, #1c3f66 58%, var(--brand-700) 100%);
    border-radius: 14px;
    padding: 72px 28px 64px;
    margin: 6px 0 44px;
    box-shadow: var(--shadow-lift);
}
.hero h1 { color: #fff; font-size: 2.6rem; line-height: 1.12; margin: 0 0 14px; letter-spacing: -.015em; }
.hero p { font-size: 1.18rem; color: rgba(255, 255, 255, .86); max-width: 620px; margin: 0 auto 12px; }
.hero .hero-actions { margin: 26px auto 0; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .hero-actions .btn { font-size: 1.02rem; padding: 12px 28px; border-radius: 8px; }
.hero .hero-actions .btn-primary { background: #fff; color: var(--brand-700); border-color: #fff; }
.hero .hero-actions .btn-primary:hover { background: var(--brand-050); border-color: var(--brand-050); }
.hero .hero-actions .btn:not(.btn-primary) { background: transparent; border-color: rgba(255, 255, 255, .55); }
.hero .hero-actions .btn:not(.btn-primary):hover { background: rgba(255, 255, 255, .12); }
.hero .hero-legal { font-size: .85rem; color: rgba(255, 255, 255, .55); margin-top: 26px; }
.hero .hero-legal a { color: rgba(255, 255, 255, .8); text-decoration: underline; }

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.feature {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px; box-shadow: var(--shadow);
    display: flex; flex-direction: column;
}
.feature h2 { margin: 0 0 10px; font-size: 1.12rem; }
.feature h2::before {
    content: ""; display: block; width: 34px; height: 4px; border-radius: 2px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    margin-bottom: 14px;
}
.feature p { margin: 0 0 12px; color: var(--muted); flex: 1; }
.feature p:last-child { flex: 0; margin: 0; }
.feature .btn { align-self: flex-start; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 320px)); gap: 20px; justify-content: center; }
.plan {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 30px 28px; box-shadow: var(--shadow); text-align: center;
    display: flex; flex-direction: column;
}
.plan h2 { margin: 0; font-size: 1.15rem; }
.plan .plan-price {
    font-family: var(--font-head); font-size: 2.3rem; font-weight: 700;
    color: var(--heading); margin: 10px 0 4px;
}
.plan .plan-quota, .plan .plan-description { color: var(--muted); margin: 4px 0; flex: 1; }
.plan .btn { margin-top: 18px; }

.prose { max-width: 720px; }
.prose h2 { margin-top: 1.7em; }
address { font-style: normal; }

/* ---------- Utility ---------- */

.hp-field { position: absolute; left: -6000px; top: -6000px; }

code { background: var(--brand-050); padding: 2px 6px; border-radius: 4px; font-size: .9em; color: var(--brand-700); }
ul { padding-left: 20px; }
li { margin: 3px 0; }

@media (max-width: 600px) {
    .hero { padding: 48px 20px 44px; }
    .hero h1 { font-size: 1.9rem; }
    .site-header .bar, .site-footer .bar { flex-direction: column; align-items: flex-start; }
    .auth-card { padding: 26px 22px; }
    main.container { margin-top: 24px; }
}
