/* ============================================================
   DEIJS.EU BILLING — app shell + sign-in (2026-09-26)
   Same language as deijs.eu: mint/forest palette, glass bars,
   pulsing light line. Three layouts:
     phone ≤767   compact top bar + floating tab bar
     iPad 768–1199 floating side rail
     desktop ≥1200 top bar with segmented tool switcher
   ============================================================ */
:root {
    --accent: #c9d8c5; --accent-rgb: 201, 216, 197; --mint: #d9dcbd; --lime: #e1e2d0;
    --bg: #141615; --bg-2: #1a1f1d; --text: #faf8f5; --muted: #b8c4b8; --faint: #8a978d;
    --glass: rgba(20, 24, 22, .74); --glass-strong: rgba(18, 22, 20, .94);
    --surface: rgba(255, 255, 255, .04); --surface-2: rgba(255, 255, 255, .08);
    --border: rgba(166, 178, 161, .16); --border-2: rgba(166, 178, 161, .3);
    --tint: rgba(201, 216, 197, .12);
    --shadow: 0 18px 50px -18px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .25);
    --light-a: #a6b2a1; --light-b: #f4f4ec;
    --ease: cubic-bezier(.16, 1, .3, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
    --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px);
    --top-h: 68px; --rail-w: 0px; --bot-h: 0px;
    --font-h: 'Montserrat', system-ui, sans-serif; --font-b: 'Roboto', system-ui, sans-serif;
}
[data-theme="light"] {
    --accent: #586057; --accent-rgb: 88, 96, 87;
    --bg: #f4f4ec; --bg-2: #fbfbf6; --text: #262b25; --muted: #4d544b; --faint: #656d61;
    --glass: rgba(244, 244, 236, .8); --glass-strong: rgba(250, 250, 244, .96);
    --surface: rgba(61, 68, 60, .035); --surface-2: rgba(61, 68, 60, .07);
    --border: rgba(61, 68, 60, .12); --border-2: rgba(61, 68, 60, .22);
    --tint: rgba(88, 96, 87, .12);
    --shadow: 0 18px 50px -22px rgba(61, 68, 60, .35), 0 2px 6px rgba(61, 68, 60, .08);
    --light-a: #3d443c; --light-b: #333333;
}
@media (max-width: 767px) { :root { --top-h: calc(58px + var(--safe-t)); --bot-h: calc(86px + var(--safe-b)); } }
@media (min-width: 768px) and (max-width: 1199px) { :root { --top-h: 0px; --rail-w: calc(108px + var(--safe-l)); } }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    background: var(--bg); color: var(--text);
    font: 400 16px/1.55 var(--font-b);
    -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
    transition: background-color .4s var(--ease), color .4s var(--ease);
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }

/* ---------- shared bits ---------- */
.brand-mark {
    width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px;
    font: 800 1.15rem/1 var(--font-h); color: #1f231e; text-decoration: none;
    background: linear-gradient(135deg, #c9d8c5 0%, #d9dcbd 55%, #e1e2d0 100%);
    box-shadow: 0 8px 22px -10px rgba(201, 216, 197, .8), inset 0 1px 0 rgba(255, 255, 255, .45);
    transition: transform .5s var(--spring);
}
[data-theme="light"] .brand-mark { color: #f4f4ec; background: linear-gradient(135deg, #3d443c 0%, #586057 60%, #586057 100%); }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; min-height: 44px; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-word { font: 700 1.1rem/1 var(--font-h); letter-spacing: .1em; white-space: nowrap; }
.brand-word b { color: #d9dcbd; font-weight: 700; }
[data-theme="light"] .brand-word b { color: #3d443c; }
.brand-word em {
    font-style: normal; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
    margin-left: .55rem; padding: .3rem .5rem; border-radius: 8px; vertical-align: 2px;
    color: var(--accent); background: var(--tint); border: 1px solid rgba(var(--accent-rgb), .25);
}
.icon-btn {
    width: 44px; height: 44px; flex: none; display: grid; place-items: center; cursor: pointer;
    border-radius: 13px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
    transition: transform .35s var(--spring), background-color .25s, border-color .25s, color .25s;
}
.icon-btn:hover { border-color: var(--border-2); background: var(--surface-2); color: var(--accent); }
.icon-btn:active { transform: scale(.9); }
.theme-ico { position: relative; width: 18px; height: 18px; display: block; }
.theme-ico i { position: absolute; inset: 0; display: grid; place-items: center; transition: transform .6s var(--spring), opacity .35s; }
[data-theme="dark"] .theme-ico .ico-sun, [data-theme="light"] .theme-ico .ico-moon { opacity: 0; transform: rotate(-90deg) scale(.4); }

/* ---------- app shell ---------- */
body.app { overflow: hidden; }
.topbar {
    position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: var(--top-h); padding: var(--safe-t) clamp(16px, 2.4vw, 32px) 0;
    display: flex; align-items: center; gap: 1rem;
    background: var(--glass); border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
}
.topbar::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; pointer-events: none;
    background: linear-gradient(90deg, transparent 0%, var(--light-a) 30%, var(--light-b) 50%, var(--light-a) 70%, transparent 100%);
    background-size: 50% 100%; background-repeat: no-repeat; animation: lightRun 4s ease-in-out infinite;
}
@keyframes lightRun { from { background-position: -60% 0; } to { background-position: 160% 0; } }
.topnav {
    margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 4px;
    border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
}
.topnav a {
    display: flex; align-items: center; justify-content: center; gap: .55rem; min-height: 44px; padding: 0 1.1rem;
    border-radius: 12px; text-decoration: none; white-space: nowrap;
    font: 600 .88rem/1 var(--font-h); color: var(--muted); transition: color .25s, background-color .25s;
}
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topnav a[aria-current="page"] { color: var(--text); background: var(--tint); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .3); }
.topnav a[aria-current="page"] i { color: var(--accent); }
.tools-right { display: flex; align-items: center; gap: 10px; }

.account { position: relative; }
.account-btn {
    display: flex; align-items: center; gap: .6rem; height: 44px; padding: 0 .8rem 0 .35rem; cursor: pointer;
    border-radius: 13px; border: 1px solid var(--border); background: var(--surface);
    font: 500 .85rem/1 var(--font-b); color: var(--text);
}
.account-btn:hover { border-color: var(--border-2); }
.account-btn .fa-chevron-down { font-size: .7rem; color: var(--faint); }
.avatar { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font: 700 .85rem/1 var(--font-h); color: #1f231e; background: var(--accent); }
.account-mail { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 260px; padding: 8px; z-index: 60;
    border-radius: 18px; border: 1px solid var(--border); background: var(--glass-strong); box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.account-who { margin: 6px 10px 10px; font-size: .8rem; color: var(--muted); line-height: 1.45; }
.account-who strong { color: var(--text); font-weight: 500; }
.account-menu a, .account-menu button {
    display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px;
    background: none; text-decoration: none; cursor: pointer; font: 500 .9rem/1 var(--font-b); color: var(--text); text-align: left;
}
.account-menu a:hover, .account-menu button:hover { background: var(--surface-2); }
.account-menu form { margin: 0; }
.account-menu i { width: 18px; color: var(--accent); }

/* rail (iPad) */
.rail { display: none; }
.tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    min-height: 60px; width: 100%; padding: 6px 2px; border: 0; border-radius: 18px; background: none; cursor: pointer;
    font: 600 .7rem/1.1 var(--font-h); color: var(--muted); text-decoration: none; text-align: center;
    transition: color .25s, background-color .25s, transform .35s var(--spring);
}
.tab i { font-size: 1.15rem; }
.tab:active { transform: scale(.9); }
.tab[aria-current="page"] { color: var(--text); background: var(--tint); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .25); }
.tab[aria-current="page"] i { color: var(--accent); }
@media (min-width: 768px) and (max-width: 1199px) {
    .topbar { display: none; }
    .rail {
        position: fixed; z-index: 50; left: calc(12px + var(--safe-l)); top: calc(12px + var(--safe-t)); bottom: calc(12px + var(--safe-b));
        width: 84px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px;
        border-radius: 28px; border: 1px solid var(--border); background: var(--glass); box-shadow: var(--shadow);
        -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
    }
    .rail-brand { width: 48px; height: 48px; border-radius: 15px; font-size: 1.3rem; margin-bottom: 8px; }
    .rail-nav { display: flex; flex-direction: column; gap: 4px; width: 100%; flex: 1; }
    .rail-tools { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding-top: 10px; border-top: 1px solid var(--border); }
    .rail-tools form { margin: 0; }
    .rail-tools .icon-btn { width: 52px; height: 52px; border-radius: 16px; }
}

/* tab bar (phone) */
.tabbar { display: none; }
@media (max-width: 767px) {
    .topnav, .account { display: none; }
    .topbar { padding-inline: 14px; }
    .brand-mark { width: 36px; height: 36px; font-size: 1.05rem; border-radius: 11px; }
    .brand-word { font-size: .98rem; }
    .brand-word em { margin-left: .4rem; }
    .tools-right { margin-left: auto; }
    .tabbar {
        position: fixed; z-index: 50; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); height: 68px; padding: 6px;
        display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px;
        border-radius: 24px; border: 1px solid var(--border); background: var(--glass); box-shadow: var(--shadow);
        -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
    }
    .tabbar .tab { min-height: 56px; border-radius: 18px; font-size: .66rem; }
    .tab-form { margin: 0; display: contents; }
}

/* the stage holds the tool frames */
.stage {
    position: fixed; top: var(--top-h); left: var(--rail-w); right: 0; bottom: var(--bot-h);
    padding: 14px;
}
@media (min-width: 768px) and (max-width: 1199px) { .stage { padding: 12px 12px 12px 4px; } }
@media (max-width: 767px) { .stage { padding: 8px 8px 4px; } }
.tool {
    position: absolute; inset: inherit; top: 14px; left: 14px; right: 14px; bottom: 14px;
    border-radius: 24px; overflow: hidden;
    border: 1px solid var(--border); background: var(--bg-2); box-shadow: var(--shadow);
    animation: toolIn .5s var(--ease);
}
@media (min-width: 768px) and (max-width: 1199px) { .tool { top: 12px; left: 4px; right: 12px; bottom: 12px; } }
@media (max-width: 767px) { .tool { top: 8px; left: 8px; right: 8px; bottom: 4px; border-radius: 20px; } }
@keyframes toolIn { from { opacity: 0; transform: translateY(8px) scale(.995); } }
.tool iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }
.tool-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tool-loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: dot 1.1s infinite ease-in-out; }
.tool-loading span:nth-child(2) { animation-delay: .15s; } .tool-loading span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-6px); } }

/* ---------- sign-in screens ---------- */
body.auth-page {
    min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: calc(24px + var(--safe-t)) 16px calc(24px + var(--safe-b)); overflow-x: hidden;
}
.auth-glow {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(var(--accent-rgb), .16), transparent 55%),
        radial-gradient(ellipse at 90% 100%, rgba(255, 180, 120, .08), transparent 50%);
}
.auth-card {
    width: min(460px, 100%); padding: clamp(24px, 5vw, 40px);
    border-radius: 28px; border: 1px solid var(--border); background: var(--glass-strong); box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
    animation: toolIn .6s var(--ease);
}
.auth-brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; margin-bottom: 28px; min-height: 44px; }
.auth-icon {
    width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 18px;
    font-size: 1.35rem; color: var(--accent); background: var(--tint); border: 1px solid rgba(var(--accent-rgb), .3);
}
.auth-card h1 { margin: 0 0 10px; font: 800 1.6rem/1.15 var(--font-h); letter-spacing: -.01em; }
.auth-lead { margin: 0 0 22px; color: var(--muted); }
.auth-lead strong { color: var(--text); font-weight: 500; }
.auth-hint { margin: -10px 0 20px; color: var(--faint); font-size: .9rem; }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.auth-form label { font: 600 .78rem/1 var(--font-h); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.auth-form input[type="email"] {
    min-height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--border-2);
    background: var(--surface); color: var(--text); font: 400 1rem/1 var(--font-b);
    transition: border-color .25s, box-shadow .25s;
}
.auth-form input[type="email"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .15); }
.auth-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 52px; margin-top: 8px; padding: 0 1.2rem;
    border: 0; border-radius: 14px; cursor: pointer; text-decoration: none;
    font: 700 .95rem/1 var(--font-h); color: #1f231e;
    background: linear-gradient(135deg, #c9d8c5, #d9dcbd 60%, #e1e2d0);
    box-shadow: 0 14px 30px -14px rgba(201, 216, 197, .8);
    transition: transform .35s var(--spring), box-shadow .3s;
}
[data-theme="light"] .auth-btn { color: #f4f4ec; background: linear-gradient(135deg, #3d443c, #586057 60%, #586057); box-shadow: 0 14px 30px -14px rgba(61, 68, 60, .6); }
.auth-btn:hover { transform: translateY(-1px); }
.auth-btn:active { transform: scale(.97); }
.auth-btn.ghost { width: 100%; color: var(--text); background: var(--surface); border: 1px solid var(--border-2); box-shadow: none; }
.auth-alert, .auth-note { display: flex; gap: .6rem; align-items: flex-start; margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; font-size: .9rem; }
.auth-alert { background: rgba(255, 107, 107, .1); border: 1px solid rgba(255, 107, 107, .3); color: #ffb4b4; }
[data-theme="light"] .auth-alert { color: #a3434f; }
.auth-note { background: var(--tint); border: 1px solid rgba(var(--accent-rgb), .3); color: var(--accent); }
.auth-alert i, .auth-note i { margin-top: 3px; }
.auth-foot { margin: 20px 0 0; font-size: .82rem; color: var(--faint); }
.auth-foot a { color: var(--muted); display: inline-flex; min-height: 44px; align-items: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Brand mark = the sprout-D icon (2026-09-26); same tile in both themes */
.brand-mark, [data-theme="light"] .brand-mark {
    background: #1f231e url('/assets/icon/brand-mark.webp') center / cover no-repeat !important;
    color: transparent !important; font-size: 0 !important; text-indent: -9999px; overflow: hidden;
    box-shadow: 0 8px 22px -12px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(201, 216, 197, .18) !important;
}

.brand-mark, [data-theme="light"] .brand-mark { background-color: #e7e7e6 !important; box-shadow: 0 6px 18px -10px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.25) !important; }
