/* Shared chrome for every app in the Legacy Intelligent System:
   design tokens, the top bar, the portal tiles, and the generic card/button
   each app's own stylesheet builds on. */

:root {
    --navy: #202360;
    --navy-deep: #1a1d4f;
    --teal: #73b0a4;
    --gray: #f2f2f2;
    --ink: #222;
    --muted: #6b7280;
    --line: #e3e5ee;
    --hero: #dfe7fa;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #fafafa;
    color: var(--ink);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

/* ---------------------------------------------------------------- top bar */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
    background: var(--navy);
}

.brand {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    background: #fff;
    border-radius: 8px;
    line-height: 0;
}

.brand img { height: 30px; width: auto; }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.topnav-link,
.menu-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: #fff;
    font: inherit;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

.topnav-link:hover,
.menu-button:hover { background: rgba(255, 255, 255, .12); }

.topnav-link:focus-visible,
.menu-button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
}

/* ------------------------------------------------------------------- menu */

.menu { position: relative; }

.menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 40;
    display: none;
    min-width: 232px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(26, 29, 79, .16);
}

.menu.open .menu-list { display: block; }

.menu-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--ink);
    font-size: 14px;
    text-decoration: none;
}

.menu-list a:hover { background: #f4f6ff; color: var(--navy); }

.soon {
    flex: none;
    padding: 1px 7px;
    border-radius: 99px;
    background: var(--gray);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ------------------------------------------------------------------- hero */

.hero {
    padding: 44px 24px 52px;
    background: var(--hero);
    text-align: center;
}

.hero-logo { height: 62px; width: auto; margin-bottom: 14px; }

.hero h1 {
    margin: 0 0 10px;
    font-size: 38px;
    line-height: 1.15;
    color: var(--navy);
    letter-spacing: -.01em;
}

.hero p {
    max-width: 640px;
    margin: 0 auto;
    color: #4b5563;
    font-size: 16px;
}

/* ------------------------------------------------------------------- main */

main { max-width: 760px; margin: 32px auto; padding: 0 20px 60px; }
main.wide { max-width: 1180px; }
main.portal { max-width: 1320px; margin-top: 40px; }

.card {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 22px;
    border: none;
    border-radius: 4px;
    background: var(--navy);
    color: #fff;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover { opacity: .9; }

.messages { list-style: none; padding: 0; }

.messages li {
    margin-bottom: 10px;
    padding: 8px 14px;
    border-radius: 4px;
    background: #fbe1e1;
    color: #a11;
}

/* --- download bar, repeated above and below a generated document --- */
/* Shared: the Proposal Builder and the Document Analyzer both offer the same
   download above and below what is on screen. */
.download-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 0;
}

.download-bar .btn { margin-top: 0; }
.download-bar .meta { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------- app tiles */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 20px;
}

.tile {
    position: relative;          /* anchors the launch link's overlay */
    display: flex;
    flex-direction: column;
    padding: 24px 24px 22px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.tile:hover {
    transform: translateY(-2px);
    border-color: #c8cee6;
    box-shadow: 0 12px 26px rgba(26, 29, 79, .12);
}

/* Keyboard users land on the launch link; light up the whole tile for them. */
.tile:focus-within {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(32, 35, 96, .16);
}

.tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--teal), var(--navy));
    color: #fff;
}

.tile-icon svg { width: 23px; height: 23px; }

.tile-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 10px;
    font-size: 17px;
    color: var(--navy);
}

.tile-desc {
    flex: 1 1 auto;
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14px;
}

.tile-launch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 6px;
    background: var(--navy);
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
}

/* This is what makes the tile itself behave like the button. */
.tile-launch::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
}

.tile:hover .tile-launch { background: var(--navy-deep); }
.tile-launch:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.tile-launch .arrow { transition: transform .16s ease; }
.tile:hover .tile-launch .arrow { transform: translateX(3px); }

.tile-soon .tile-icon { background: linear-gradient(135deg, #aab2cf, #6b7396); }

/* ------------------------------------------- end-of-result action buttons */
/* Shown once an app has finished: run it again, or go choose another app.
   Buttons rather than links because they are the page's next step, not an
   aside — see templates/_result_actions.html. */
.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.action {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.action svg { width: 16px; height: 16px; flex: none; }

.action-primary { background: var(--navy); color: #fff; }
.action-primary:hover { background: var(--navy-deep); transform: translateY(-1px); }

.action-secondary { background: #fff; color: var(--navy); border-color: #c8cee6; }
.action-secondary:hover { background: #f4f6ff; border-color: var(--navy); transform: translateY(-1px); }

.action:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

@media (max-width: 520px) {
    .result-actions { flex-direction: column; }
    .action { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .action { transition: none; }
    .action:hover { transform: none; }
}

/* --------------------------------------------------------- app shell page */

.shell-eyebrow {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.shell h2 { margin: 0 0 10px; color: var(--navy); }
.shell-desc { color: var(--muted); margin: 0 0 20px; }

.shell-note {
    padding: 14px 16px;
    border: 1px solid #e6dcc3;
    border-left: 3px solid #c9a227;
    border-radius: 6px;
    background: #fdfaf0;
    font-size: 14px;
    margin-bottom: 22px;
}

@media (max-width: 720px) {
    .hero h1 { font-size: 28px; }
    .topbar { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    .tile,
    .tile-launch .arrow { transition: none; }
    .tile:hover { transform: none; }
}
