/* ============================================================================
   APP Discussions — signed-in dark theme (app.css)
   Shared design system for the in-app pages (Dashboard, Account, What's New,
   project area, Admin, etc.). Login has its own bespoke styles.
   Form inputs are styled via the .field class only (NOT bare input/textarea/
   select selectors) so Telerik RadControls render unaffected.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Outfit:wght@300;400;500;600&display=swap');

:root {
    --ink: #080c17;
    --ink-2: #0d1426;
    --surface: rgba(255,255,255,.045);
    --surface-2: rgba(255,255,255,.07);
    --border: rgba(255,255,255,.10);
    --border-strong: rgba(255,255,255,.18);
    --accent: #16c0a8;
    --accent-2: #38d6f0;
    --gold: #f6b54a;
    --danger: #ff6b6b;
    --heading: #f4f8ff;
    --text: #dce5f1;
    --muted: #93a6bd;
    --muted-2: #6c7d93;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Outfit', system-ui, sans-serif;
    color: var(--text);
    background:
        radial-gradient(1100px 600px at 85% -10%, rgba(56,214,240,.10), transparent 60%),
        radial-gradient(900px 600px at 0% 0%, rgba(22,192,168,.12), transparent 55%),
        linear-gradient(170deg, var(--ink) 0%, var(--ink-2) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}
form { min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

/* ---------- header / nav ---------- */
.app-header {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 14px clamp(18px, 4vw, 40px);
    background: rgba(8,12,23,.72);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--heading); }
.brand:hover { color: var(--heading); }
.brand .mark { width: 30px; height: 30px; display: block; }
.brand .word { font-weight: 600; letter-spacing: .13em; text-transform: uppercase; font-size: 13px; }

.app-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.app-nav a {
    color: var(--muted); font-size: 14px; font-weight: 500;
    padding: 7px 12px; border-radius: 9px; transition: color .15s, background .15s;
}
.app-nav a:hover { color: var(--heading); background: var(--surface-2); }
.app-nav a.active { color: var(--accent); background: rgba(22,192,168,.12); }
.app-nav a.active:hover { color: var(--accent); }
.app-nav a.nav-signout { color: var(--muted-2); }
.app-nav a.nav-signout:hover { color: var(--danger); background: rgba(255,107,107,.10); }

/* ---------- main ---------- */
.app-main {
    flex: 1 0 auto;
    width: 100%; max-width: 1080px; margin: 0 auto;
    padding: clamp(28px, 5vw, 56px) clamp(18px, 4vw, 40px);
}
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; font-size: 12px; margin: 0 0 8px; }
.page-title {
    font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-optical-sizing: auto;
    font-size: clamp(30px, 4vw, 46px); line-height: 1.05; letter-spacing: -.01em;
    color: var(--heading); margin: 0;
}
.section-title {
    font-family: 'Fraunces', Georgia, serif; font-weight: 600;
    font-size: 22px; color: var(--heading); margin: 34px 0 16px; letter-spacing: -.01em;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.role-badge {
    display: inline-block; margin-top: 10px; padding: 4px 11px; border-radius: 999px;
    font-size: 12px; font-weight: 600; letter-spacing: .04em;
    color: var(--accent); background: rgba(22,192,168,.12); border: 1px solid rgba(22,192,168,.30);
}

/* ---------- project cards (light cards on the dark page) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }
.project-card {
    --card-accent: var(--accent);
    position: relative; display: flex; flex-direction: column; gap: 6px;
    padding: 20px 20px 18px; border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #eef2f8);
    border: 1px solid rgba(15,23,42,.10); border-left: 3px solid var(--card-accent);
    color: #28323f; overflow: hidden;
    box-shadow: 0 12px 28px -18px rgba(0,0,0,.7);
    transition: transform .16s ease, box-shadow .2s ease;
}
.project-card::after {
    content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px;
    background: radial-gradient(circle, var(--card-accent), transparent 70%);
    opacity: .12; transition: opacity .2s ease;
}
.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 48px -20px rgba(0,0,0,.75);
    color: #28323f;
}
.project-card:hover::after { opacity: .2; }
.pc-name { font-size: 17px; font-weight: 600; color: #0e1726; }
.pc-code { font-size: 12px; color: #738598; letter-spacing: .02em; }
.pc-go { margin-top: 10px; font-size: 13px; font-weight: 600; color: #0f8e7e; opacity: 0; transform: translateX(-4px); transition: opacity .16s, transform .16s; }
.project-card:hover .pc-go { opacity: 1; transform: none; }

/* ---------- empty / flash messages ---------- */
.empty {
    padding: 28px; border: 1px dashed var(--border-strong); border-radius: 14px;
    background: var(--surface); color: var(--muted); text-align: center;
}
.flash { padding: 11px 14px; border-radius: 11px; font-size: 14px; margin: 0 0 18px; border: 1px solid var(--border); }
.flash-ok { color: #7ef0d6; background: rgba(22,192,168,.12); border-color: rgba(22,192,168,.32); }
.flash-err { color: #ffb4b4; background: rgba(255,107,107,.10); border-color: rgba(255,107,107,.32); }

/* ---------- generic components ---------- */
.panel {
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border); border-radius: 16px; padding: 24px clamp(18px,3vw,28px);
}
.card-h { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 18px; color: var(--heading); margin: 0 0 12px; }
.card-h + .card-h, .panel > .card-h:not(:first-child) { margin-top: 26px; }
.divider { height: 1px; background: var(--border); margin: 22px 0; border: 0; }

.btn {
    display: inline-block; cursor: pointer; font: inherit; font-weight: 600; text-align: center;
    padding: 11px 18px; border-radius: 11px; border: 1px solid var(--border-strong);
    background: var(--surface-2); color: var(--heading);
    transition: transform .12s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.10); color: var(--heading); }
.btn-primary {
    border: none; color: #06231f;
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 24px -12px rgba(22,192,168,.7);
}
.btn-primary:hover { filter: brightness(1.05); color: #06231f; background: linear-gradient(100deg, var(--accent), var(--accent-2)); }

/* ---------- forms (class-scoped; safe alongside Telerik) ---------- */
.field-label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 6px; }
.form-row { margin-bottom: 18px; }
.field {
    width: 100%; padding: 11px 13px; font: inherit; color: var(--heading);
    background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 10px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.field:focus {
    outline: none; background: rgba(255,255,255,.07); border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(22,192,168,.16);
}
select.field option { color: #0e1726; }
input[type=radio], input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }

/* RadioButtonList (RepeatLayout=Flow) and CheckBox stacks */
.radio-list label { display: inline-block; padding: 5px 0; color: var(--text); }
fieldset.opts { border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin: 12px 0 0; }
fieldset.opts legend { padding: 0 8px; color: var(--muted); font-size: 13px; }
fieldset.opts label { color: var(--text); line-height: 2.0; }

/* ---------- tables ---------- */
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th { text-align: left; padding: 11px 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border-strong); }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
table.data tr:hover td { background: var(--surface); }

/* ---------- footer ---------- */
.app-foot {
    flex-shrink: 0; text-align: center; color: var(--muted-2); font-size: 12px;
    padding: 26px 20px 30px; border-top: 1px solid var(--border);
}

/* ---------- entrance ---------- */
.reveal { opacity: 0; transform: translateY(12px); animation: rise .6s cubic-bezier(.2,.7,.2,1) forwards; }
.d1 { animation-delay: .04s; } .d2 { animation-delay: .12s; } .d3 { animation-delay: .2s; } .d4 { animation-delay: .28s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* images never overflow (carries the responsive intent app-wide) */
img { max-width: 100%; height: auto; }

@media (max-width: 600px) {
    .app-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    table.data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (prefers-reduced-motion: reduce) {
    .reveal { animation: none; opacity: 1; transform: none; }
    .project-card { transition: none; }
}
