/* ViviScape Community — brand stylesheet
   Palette + tokens per the ViviScape Style Guide. Mobile-first, responsive. */

:root {
    --navy: #0b1d35;
    --navy-mid: #0f2847;
    --navy-light: #14355c;
    --orange: #e8833a;
    --orange-light: #f4a261;
    --orange-hover: #d6722c;
    --bg: #f8f9fc;
    --text-800: #2d3142;
    --text-600: #5a6275;
    --text-400: #a0a8b8;
    --white: #fff;
    --line: #e7eaf1;

    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;

    --sh-xs: 0 1px 2px rgba(11,29,53,.04);
    --sh-sm: 0 2px 8px rgba(11,29,53,.06);
    --sh-md: 0 8px 24px rgba(11,29,53,.08);
    --sh-lg: 0 16px 48px rgba(11,29,53,.14);

    --maxw: 1200px;
    --ease: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text-600);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
    font-family: 'Poppins', sans-serif;
    color: var(--text-800);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 .5em;
}

a { color: var(--navy-light); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--orange); }

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

.muted { color: var(--text-400); }
.small { font-size: .85rem; }
.label {
    font-family: 'Poppins', sans-serif; font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 2.5px; color: var(--orange);
}

/* ---------------- top nav ---------------- */
.topbar { background: var(--navy); position: sticky; top: 0; z-index: 50; box-shadow: var(--sh-sm); }
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: 'Poppins', sans-serif;
         font-weight: 700; font-size: 1.2rem; color: var(--white); white-space: nowrap; }
.brand .accent { color: var(--orange); }
.brand-mark { width: 38px; height: 38px; display: block; object-fit: contain; }

.nav-links { display: flex; gap: 4px; margin-left: 12px; flex: 1; }
.nav-links a {
    color: #cbd5e6; font-size: .94rem; font-weight: 500; padding: 8px 14px; border-radius: var(--r-sm);
    transition: all var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--white); background: var(--navy-light); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--white); font-size: 1.6rem; cursor: pointer; }

/* ---------------- buttons ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: 'Poppins', sans-serif; font-weight: 600; font-size: .92rem;
    padding: 10px 20px; border-radius: var(--r-sm); border: 0; cursor: pointer;
    transition: all var(--ease); text-decoration: none; line-height: 1;
}
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: var(--orange-hover); color: var(--white); }
.btn-ghost { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.25); }
.btn-ghost:hover { background: rgba(255,255,255,.08); color: var(--white); }
.btn-outline { background: var(--white); color: var(--navy); border: 1px solid var(--line); }
.btn-outline:hover { border-color: var(--orange); color: var(--orange); }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn-block { width: 100%; }

/* ---------------- layout grid ---------------- */
.page { padding: 28px 0 64px; }
.layout-3 { display: grid; grid-template-columns: 260px 1fr 300px; gap: 24px; align-items: start; }
.layout-2 { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.sticky { position: sticky; top: 84px; }

/* ---------------- cards ---------------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
        box-shadow: var(--sh-xs); padding: 20px; margin-bottom: 18px; }
.card-pad-lg { padding: 28px; }
.card h3 { font-size: 1.05rem; }
.card-title { font-family: 'Poppins', sans-serif; font-weight: 600; color: var(--text-800);
              font-size: .78rem; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 14px; }

/* ---------------- post list ---------------- */
.post { display: flex; gap: 14px; padding: 18px 20px; background: var(--white); border: 1px solid var(--line);
        border-radius: var(--r-md); margin-bottom: 14px; box-shadow: var(--sh-xs); transition: box-shadow var(--ease); }
.post:hover { box-shadow: var(--sh-md); }
.post-vote { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 44px; }
.vote-btn { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
            width: 40px; height: 34px; cursor: pointer; color: var(--text-400); font-size: 1rem;
            transition: all var(--ease); }
.vote-btn:hover { border-color: var(--orange); color: var(--orange); }
.vote-btn.on { background: var(--orange); color: #fff; border-color: var(--orange); }
.vote-score { font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--text-800); }
.post-body { flex: 1; min-width: 0; }
.post-title { font-family: 'Poppins', sans-serif; font-weight: 600; color: var(--text-800);
              font-size: 1.12rem; margin: 0 0 6px; }
.post-title a { color: inherit; }
.post-title a:hover { color: var(--orange); }
.post-excerpt { color: var(--text-600); margin: 0 0 10px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: .84rem; color: var(--text-400); }
.post-meta a { color: var(--text-600); font-weight: 500; }

/* type + status pills */
.pill { display: inline-flex; align-items: center; gap: 5px; font-family: 'Poppins', sans-serif;
        font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .8px;
        padding: 4px 9px; border-radius: 999px; }
.pill-discussion { background: #eef2fb; color: var(--navy-light); }
.pill-question   { background: #fdeee2; color: var(--orange-hover); }
.pill-article    { background: #e9f6ef; color: #1f8a5b; }
.pill-announcement { background: #fbe9ec; color: #c0394e; }
.pill-answered   { background: #e9f6ef; color: #1f8a5b; }
.pill-pinned     { background: var(--navy); color: #fff; }

/* ---------------- avatars ---------------- */
.avatar { border-radius: 50%; background: linear-gradient(135deg, var(--navy-light), var(--navy-mid));
          color: #fff; display: inline-flex; align-items: center; justify-content: center;
          font-family: 'Poppins', sans-serif; font-weight: 600; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: .8rem; }
.avatar-md { width: 44px; height: 44px; font-size: .95rem; }
.avatar-lg { width: 88px; height: 88px; font-size: 1.8rem; }

/* ---------------- side nav (spaces) ---------------- */
.side-nav { list-style: none; padding: 0; margin: 0; }
.side-nav li a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm);
                 color: var(--text-600); font-weight: 500; transition: all var(--ease); }
.side-nav li a:hover { background: var(--bg); color: var(--navy); }
.side-nav .ico { width: 30px; height: 30px; border-radius: 8px; background: var(--bg);
                 display: inline-flex; align-items: center; justify-content: center; color: var(--orange); }
.side-nav .count { margin-left: auto; font-size: .78rem; color: var(--text-400); }

/* ---------------- space / app cards grid ---------------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.space-card, .app-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
                         padding: 22px; box-shadow: var(--sh-xs); transition: all var(--ease); }
.space-card:hover, .app-card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.space-card .ico, .app-logo { width: 48px; height: 48px; border-radius: var(--r-sm);
        background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: #fff;
        display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 14px; }
.app-card .app-logo { background: linear-gradient(135deg, var(--orange), var(--orange-light)); }

/* ---------------- tags ---------------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--bg); border: 1px solid var(--line); color: var(--text-600);
       font-size: .8rem; padding: 5px 11px; border-radius: 999px; transition: all var(--ease); }
.tag:hover { border-color: var(--orange); color: var(--orange); }

/* ---------------- hero / landing ---------------- */
.hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 60%, var(--navy-light) 100%);
        color: #fff; padding: 84px 0 96px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px;
               border-radius: 50%; background: radial-gradient(circle, rgba(232,131,58,.22), transparent 70%); }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.4rem); max-width: 760px; }
.hero h1 .accent { color: var(--orange); }
.hero p { color: #c3cfe0; font-size: 1.15rem; max-width: 580px; margin: 18px 0 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.stat-row { display: flex; gap: 40px; margin-top: 56px; flex-wrap: wrap; }
.stat .num { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 2rem; color: var(--orange); }
.stat .lbl { color: #97a6bd; font-size: .9rem; }

.section { padding: 64px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 { font-size: 2rem; }

/* ---------------- forms ---------------- */
.form-card { max-width: 460px; margin: 48px auto; }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: 'Poppins', sans-serif; font-weight: 500;
               color: var(--text-800); font-size: .9rem; margin-bottom: 6px; }
.field input, .field textarea, .field select {
    width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
    font-family: inherit; font-size: .95rem; color: var(--text-800); background: var(--white);
    transition: border-color var(--ease); }
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,131,58,.12); }
.field textarea { min-height: 160px; resize: vertical; }
.validation-summary-errors, .field-validation-error, .text-danger {
    color: #c0394e; font-size: .85rem; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-400); margin: 18px 0; font-size: .85rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.btn-google { background: #fff; color: var(--text-800); border: 1px solid var(--line); width: 100%; }
.btn-google:hover { border-color: var(--text-400); color: var(--text-800); }

/* ---------------- profile header ---------------- */
.profile-head { display: flex; gap: 22px; align-items: center; }
.rep { font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--orange); }
.badge-chip { display:inline-flex; align-items:center; gap:6px; background: var(--bg); border:1px solid var(--line);
              border-radius: 999px; padding: 5px 12px; font-size:.82rem; }

/* ---------------- footer ---------------- */
.footer { background: var(--navy); color: #8ea0bb; padding: 40px 0; margin-top: 40px; font-size: .9rem; }
.footer a { color: #c3cfe0; }
.footer .brand { font-size: 1.05rem; margin-bottom: 10px; }

/* ---------------- AI concierge ---------------- */
.ai-fab { position: fixed; right: 24px; bottom: 24px; width: 58px; height: 58px; border-radius: 50%;
          background: linear-gradient(135deg, var(--orange), var(--orange-light)); color: #fff; border: 0;
          font-size: 1.5rem; cursor: pointer; box-shadow: var(--sh-lg); z-index: 60; transition: transform var(--ease); }
.ai-fab:hover { transform: scale(1.06); }
.ai-panel { position: fixed; right: 24px; bottom: 92px; width: 360px; max-width: calc(100vw - 32px);
            height: 480px; max-height: calc(100vh - 130px); background: #fff; border-radius: var(--r-lg);
            box-shadow: var(--sh-lg); z-index: 60; display: none; flex-direction: column; overflow: hidden; }
.ai-panel.open { display: flex; }
.ai-head { background: var(--navy); color: #fff; padding: 16px 18px; font-family: 'Poppins', sans-serif; font-weight: 600; }
.ai-head .accent { color: var(--orange); }
.ai-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ai-msg { padding: 10px 14px; border-radius: var(--r-md); max-width: 85%; font-size: .92rem; }
.ai-msg.user { background: var(--navy); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-msg.bot { background: var(--bg); color: var(--text-800); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.ai-input input { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }

/* ---------------- alerts ---------------- */
.alert { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 16px; font-size: .9rem; }
.alert-error { background: #fbe9ec; color: #c0394e; border: 1px solid #f3c6ce; }

/* ---------------- responsive ---------------- */
@media (max-width: 992px) {
    .layout-3 { grid-template-columns: 1fr 300px; }
    .layout-3 > .col-left { display: none; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy-mid);
                 flex-direction: column; padding: 12px; gap: 2px; box-shadow: var(--sh-md); }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }
    .nav-links { margin-left: 0; }
    .layout-3, .layout-2 { grid-template-columns: 1fr; }
    .layout-3 > .col-left, .layout-2 > .col-right, .layout-3 > .col-right { display: none; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .stat-row { gap: 26px; }
    .hero { padding: 56px 0 64px; }
}
