/* AmalfiNation public pages (AMA-272): the front door at signed-out "/" and the sign-in
   card at /login. Loaded only by templates/layouts/public.html; the pages carry no
   <style> blocks or style= attributes of their own.

   Mobile first: the base rules are for a 360px phone, the media queries widen.
   Colours: slate ink on a warm off-white, the brand teal for actions. Every text colour
   here is AA (4.5:1) or better on the background it sits on:
     --ink #0f172a, --text #334155, --muted #475569 on #fbfaf7 / #fff: 7.4:1 or more;
     --teal-700 #0f766e on #fff: 5.5:1; white on --teal-700: 5.5:1. */

:root {
    --teal-700: #0f766e;
    --teal-800: #115e59;
    --teal-50: #f0fdfa;
    --teal-100: #ccfbf1;
    --ink: #0f172a;
    --text: #334155;
    --muted: #475569;
    --line: #e2e8f0;
    --bg: #fbfaf7;
    --card: #ffffff;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius: 12px;
    --gutter: 16px;
    --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.public {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.6;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--teal-700); }
a:hover { color: var(--teal-800); }

:focus-visible {
    outline: 3px solid var(--teal-700);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -100px;
    z-index: 100;
    background: var(--ink);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}
.skip-link:focus { top: 8px; color: #fff; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ------------------------------------------------------------------ header */

.public-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(251, 250, 247, 0.96);
    border-bottom: 1px solid var(--line);
}
.public-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 60px;
}
.public-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.public-nav .nav-link {
    display: none;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}
.public-nav .nav-link:hover { color: var(--ink); background: var(--teal-50); }

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
}
.logo:hover { color: var(--ink); }
.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--teal-700);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex: none;
}
.logo-text { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }

/* ------------------------------------------------------------------ buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0.6rem 1.15rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}
.btn-primary { background: var(--teal-700); color: #fff; }
.btn-primary:hover { background: var(--teal-800); color: #fff; }
.btn-secondary { background: var(--card); color: var(--ink); border-color: #94a3b8; }
.btn-secondary:hover { background: var(--teal-50); color: var(--ink); border-color: var(--teal-700); }
.btn-small { min-height: 38px; padding: 0.4rem 0.9rem; font-size: 0.95rem; }
.btn-block { width: 100%; }

.inline-form { display: inline; margin: 0; }

/* ------------------------------------------------------------------ front door */

.front-hero { padding: 40px 0 32px; }
.front-hero h1 {
    margin: 0 0 16px;
    font-family: var(--serif);
    font-weight: 600;
    color: var(--ink);
    font-size: 2rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
}
.front-hero .lede { margin: 0 0 24px; font-size: 1.1rem; max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-actions .demo-form { display: contents; }
.hero-tour { margin: 16px 0 0; }
.hero-tour a { font-weight: 600; }

.shot {
    margin: 32px 0 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.08);
}
.shot figcaption {
    padding: 10px 14px;
    font-size: 0.875rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.section { padding: 40px 0; border-top: 1px solid var(--line); scroll-margin-top: 72px; }
.section h2 {
    margin: 0 0 8px;
    font-family: var(--serif);
    font-weight: 600;
    color: var(--ink);
    font-size: 1.6rem;
    line-height: 1.2;
}
.section .section-intro { margin: 0 0 24px; color: var(--muted); max-width: 40em; }
.section h3 { margin: 0 0 6px; color: var(--ink); font-size: 1.1rem; line-height: 1.3; }
.section p { margin: 0; }

.audience { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.audience li {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
}

.features { display: grid; gap: 32px; }
.feature { display: grid; gap: 16px; align-items: center; }
.feature .shot { margin: 0; }
.feature-text h3 i { color: var(--teal-700); margin-right: 6px; }
.feature.is-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    align-items: start;
}
.feature-tool { white-space: nowrap; }

/* "Get the mobile app" on the front door: under the hero buttons and in the Mobile apps
   feature. Same wording as the sign-in card's .login-apps, left-aligned here. */
.app-links { margin: 16px 0 0; font-size: 0.95rem; }
.section .app-links-title, .app-links-title { margin: 0 0 4px; font-weight: 600; color: var(--ink); }
.app-links-list { margin: 0; padding: 0; list-style: none; }
.app-links-list li { margin: 2px 0; }
.app-links-list li i { width: 1.1em; }
.app-links-list .is-soon { color: var(--muted); }
.hero-apps { padding-top: 16px; border-top: 1px solid var(--line); max-width: 36em; }
.section-more { margin: 24px 0 0; }
.section-more a { font-weight: 600; }

.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.results li {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--teal-700);
    border-radius: var(--radius);
    padding: 16px 18px;
}

/* Root > Pricing's Preview: the draft is not live */
.preview-banner { position: sticky; top: 0; z-index: 1000; background: #b45309; color: #fff; padding: 10px 16px; text-align: center; font-weight: 600; }
.preview-banner a { color: #fff; text-decoration: underline; margin-left: 8px; }
.pricing { display: grid; gap: 16px; }
.price-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}
.price-panel.is-featured { border: 2px solid var(--teal-700); }
.price-panel .panel-subtitle { margin: 0 0 16px; color: var(--muted); font-size: 0.95rem; }
.tiers { margin: 0 0 16px; padding: 0; list-style: none; }
.tier {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.tier:last-child { border-bottom: 0; }
.tier-price { font-weight: 700; color: var(--ink); text-align: right; }
.price-notes { list-style: none; margin: 0; padding: 0; font-size: 0.95rem; }
.price-notes li { display: flex; gap: 10px; padding: 4px 0; }
.price-notes i { color: var(--teal-700); margin-top: 0.3em; flex: none; width: 1em; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: step; }
.steps li {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 18px 18px 64px;
    counter-increment: step;
}
.steps li::before {
    content: counter(step);
    position: absolute;
    left: 18px;
    top: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--teal-700);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.integration-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.integration-group h3 { font-size: 0.95rem; margin-bottom: 8px; }
.integration-group h3 i { color: var(--teal-700); margin-right: 6px; }
.integration-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.integration-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 0.9rem;
}
.integration-tag i { color: var(--teal-700); }

.news { list-style: none; margin: 0; padding: 0; }
.news-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.section .news-month { font-size: 1.05rem; font-weight: 700; color: var(--teal-700); margin: 16px 0 4px; }
.news-more { margin-top: 12px; }
.news-more summary {
    cursor: pointer;
    color: var(--teal-700);
    font-weight: 600;
    padding: 8px 0;
}

.contact-box {
    background: var(--teal-50);
    border: 1px solid var(--teal-100);
    border-radius: var(--radius);
    padding: 24px;
}
.contact-box .hero-actions { margin-top: 16px; }

.public-footer {
    border-top: 1px solid var(--line);
    padding: 24px 0 40px;
    color: var(--muted);
    font-size: 0.9rem;
}
.public-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.public-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.public-footer a { color: var(--muted); }
.public-footer a:hover { color: var(--ink); }

/* ------------------------------------------------------------------ sign-in card */

.login-main {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px 18px 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.08);
}
.login-card .logo { margin-bottom: 14px; }
.login-card h1 {
    margin: 0 0 4px;
    font-family: var(--serif);
    font-weight: 600;
    color: var(--ink);
    font-size: 1.6rem;
    line-height: 1.2;
}
.login-subtitle { margin: 0 0 14px; color: var(--muted); font-size: 0.95rem; }
.login-actions { display: grid; gap: 10px; }
.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: 1px solid #94a3b8;
    background: var(--card);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}
.login-btn:hover { background: var(--teal-50); border-color: var(--teal-700); color: var(--ink); }
.login-btn.microsoft i { color: #00a4ef; font-size: 1.1rem; }
.login-btn.is-busy { opacity: 0.7; pointer-events: none; }
.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    color: var(--muted);
    font-size: 0.85rem;
}
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-form { margin: 0; }
.demo-card { width: 100%; }
.integrations {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 16px 0 0;
}
.integration-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--muted);
}
.integration-badge i { color: var(--teal-700); }
.login-back {
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 0.95rem;
}

/* "Get the mobile app": iPhone link + Android coming soon, compact enough for a phone. */
.login-apps {
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 0.95rem;
}
.login-apps-title { margin: 0 0 4px; font-weight: 600; color: var(--ink); }
.login-apps-list { margin: 0; padding: 0; list-style: none; }
.login-apps-list li { margin: 2px 0; }
.login-apps-list li i { width: 1.1em; }
.login-apps-list .is-soon { color: var(--muted); }

.flash-messages { margin: 0 0 12px; }
.flash-message {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #fcd34d;
    background: #fef3c7;
    color: #78350f;
    font-size: 0.95rem;
}
.flash-message.is-error { border-color: #fca5a5; background: #fee2e2; color: #991b1b; }

/* ------------------------------------------------------------------ wider screens */

@media (min-width: 640px) {
    :root { --gutter: 24px; }
    .public-nav .nav-link { display: inline-flex; }
    .front-hero h1 { font-size: 2.4rem; }
    .audience { grid-template-columns: repeat(3, 1fr); }
    .results { grid-template-columns: repeat(3, 1fr); }
    .login-card { padding: 32px 32px 24px; }
}

@media (min-width: 960px) {
    .front-hero { padding: 72px 0 56px; }
    .front-hero .wrap {
        display: grid;
        grid-template-columns: 5fr 6fr;
        gap: 48px;
        align-items: center;
    }
    .front-hero .shot { margin: 0; }
    .front-hero h1 { font-size: 2.75rem; }
    .section { padding: 64px 0; }
    .section h2 { font-size: 2rem; }
    .feature { grid-template-columns: 1fr 1fr; gap: 40px; }
    .features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .feature { grid-column: 1 / -1; }
    .feature.is-card { grid-column: auto; grid-template-columns: 1fr; align-self: stretch; }
    /* Screenshots alternate sides. Named, not :nth-child: the cards between them are
       .feature siblings too and would throw the count out. */
    .feature.is-flipped .shot { order: 2; }
    .pricing { grid-template-columns: 1fr 1fr; align-items: start; }
    .steps { grid-template-columns: repeat(3, 1fr); }
    .integration-groups { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}
