/* ==========================================================================
   samata.lk Horoscope — app.css (shared samata.lk design system)
   Mobile-first (360 → 470 → 768 → 1024). No !important, no override rules.
   Sections:
     1. Fonts            5. Header & nav
     2. Tokens           6. Hero & chips
     3. Base             7. Cards & buttons
     4. Layout helpers   8. Promo & footer
   ========================================================================== */

/* 1. Fonts — self-hosted, each script loads only when its characters appear */
@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20B9, U+2122, U+2190-2199, U+2212, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Noto Sans Sinhala";
    src: url("../fonts/noto-sans-sinhala.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0D80-0DFF, U+200C-200D, U+25CC, U+111E1-111F4;
}
@font-face {
    font-family: "Noto Sans Tamil";
    src: url("../fonts/noto-sans-tamil.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0B80-0BFF, U+200C-200D, U+25CC, U+11FC0-11FFF;
}

/* 2. Tokens */
:root {
    --c-navy: #132C54;
    --c-deep: #0f3d6e;
    --c-blue: #1a5faa;
    --c-gold: #f5a623;
    --c-green: #16a34a;
    --c-bg: #F6F8FB;
    --c-card: #ffffff;
    --c-line: #e3e8ef;
    --c-text: #132C54;
    --c-muted: #64748b;

    --font: "Inter", "Noto Sans Sinhala", "Noto Sans Tamil", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 30px rgba(19, 44, 84, .08);
    --container: 1240px;
    --gutter: 14px;
    --header-h: 58px;
}

/* 3. Base */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--c-text);
    background: var(--c-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1; }

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

a { color: var(--c-blue); }

h1, h2, h3 { line-height: 1.25; margin: 0; }

.lang-si,
.lang-ta { line-height: 1.7; }

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

:focus-visible {
    outline: 2px solid var(--c-gold);
    outline-offset: 2px;
}

/* 4. Layout helpers */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section { padding-block: 16px 40px; }

/* 5. Header & nav */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--c-navy);
    color: #fff;
}

.site-header__inner {
    max-width: var(--container);
    height: var(--header-h);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    margin-right: auto;
    min-width: 0;
}

.brand__logo {
    display: block;
    width: auto;
    height: 28px;
}

/* Mobile nav = drop-down panel under the header */
.site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 8px var(--gutter) 14px;
    background: var(--c-deep);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .2);
}

.site-nav.is-open { display: flex; }

.site-nav__link {
    color: rgba(255, 255, 255, .85);
    text-decoration: none;
    padding: 12px 10px;
    border-radius: var(--radius-sm);
    font-size: 15px;
}

.site-nav__link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.site-nav__link.is-active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.site-nav__link--back { color: var(--c-gold); }
.site-nav__link--account { font-weight: 600; color: #fff; }

.lang-switch {
    display: flex;
    background: rgba(255, 255, 255, .1);
    border-radius: var(--radius-sm);
    padding: 3px;
    flex-shrink: 0;
}

.lang-switch__link {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    padding: 5px 8px;
    border-radius: 6px;
}

.lang-switch__link.is-active { background: var(--c-gold); color: var(--c-navy); font-weight: 700; }

.menu-toggle {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .1);
    cursor: pointer;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.menu-toggle__bar,
.menu-toggle__bar::before,
.menu-toggle__bar::after {
    content: "";
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    position: relative;
}

.menu-toggle__bar::before { position: absolute; top: -6px; }
.menu-toggle__bar::after { position: absolute; top: 6px; }

/* 6. Hero & chips */
.hero { padding: 20px 0 6px; }

.hero__title {
    font-size: 22px;
    letter-spacing: -.4px;
    margin-bottom: 10px;
}

.chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hero__lead { margin: 0; color: var(--c-muted); max-width: 640px; }

.chip {
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 13px;
    color: var(--c-muted);
}

.chip::before { content: "✓ "; color: var(--c-green); font-weight: 700; }

/* 7. Cards & buttons */
.card {
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card--placeholder {
    padding: 40px 20px;
    text-align: center;
    color: var(--c-muted);
}

.card--placeholder p { margin: 0 0 16px; }

/* Toast message (created by app.js) */
.toast {
    position: fixed;
    left: 50%;
    bottom: 88px;
    z-index: 50;
    width: max-content;
    max-width: calc(100% - 28px);
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--c-navy);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(19, 44, 84, .25);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 10px);
    transition: opacity .2s, transform .2s, visibility .2s;
}

.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

@media (min-width: 1024px) {
    .toast { bottom: 28px; }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.btn--gold { background: var(--c-gold); color: var(--c-navy); }
.btn--navy { background: var(--c-navy); color: #fff; }
.btn--green { background: var(--c-green); color: #fff; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn--light { background: var(--c-card); color: var(--c-navy); border: 1px solid var(--c-line); }

/* 7b. Info content: how-to, FAQ, guides, legal pages */
.info { padding-bottom: 32px; }
.info--page { padding-top: 8px; max-width: 860px; }

.info-block {
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 18px 18px 14px;
    margin-bottom: 14px;
}

.info-block__title { font-size: 18px; margin-bottom: 10px; }
.info-block__text { margin: 0 0 6px; white-space: pre-line; color: #334155; }
.info__section { margin: 26px 0 12px; font-size: 22px; color: var(--c-navy); scroll-margin-top: calc(var(--header-h) + 12px); }

.steps-list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
    display: grid;
    gap: 10px;
}

.steps-list li {
    counter-increment: step;
    position: relative;
    padding-left: 38px;
    color: #334155;
}

.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--c-navy);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.faq { display: grid; gap: 8px; }

.faq__item {
    border: 1px solid var(--c-line);
    border-radius: 10px;
    background: #fbfcfe;
}

.faq__q {
    padding: 12px 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.faq__q::-webkit-details-marker { display: none; }
.faq__q::after { content: "+"; color: var(--c-blue); font-weight: 800; }
.faq__item[open] .faq__q::after { content: "–"; }
.faq__a { margin: 0; padding: 0 14px 14px; color: #334155; }

.info-cta { text-align: center; padding: 10px 0 0; }

@media (min-width: 768px) {
    .info-block { padding: 22px 24px 18px; }
    .info-block__title { font-size: 20px; }
}

/* 7c. Error pages */
.error-page {
    padding-top: 48px;
    padding-bottom: 56px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.error-page__code {
    margin: 0;
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    color: var(--c-gold);
}

/* 8. Promo & footer */
.promo { padding: 0 var(--gutter) 28px; }

.promo__inner {
    max-width: calc(var(--container) - 2 * var(--gutter));
    margin: 0 auto;
    background: linear-gradient(90deg, var(--c-navy), var(--c-blue));
    color: #fff;
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.promo__text { margin: 0; font-weight: 600; }

.site-footer {
    background: var(--c-card);
    border-top: 1px solid var(--c-line);
}

.site-footer__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 28px var(--gutter) 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 16px;
}

.site-footer__brand { grid-column: 1 / -1; }
.site-footer__brand img { width: 150px; }

.site-footer__tagline {
    color: var(--c-muted);
    font-size: 14px;
    margin: 10px 0 0;
    max-width: 380px;
}

.site-footer__col { display: flex; flex-direction: column; gap: 8px; }

.site-footer__title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--c-muted);
    margin-bottom: 2px;
}

.site-footer__col a { color: var(--c-text); text-decoration: none; font-size: 14px; }
.site-footer__col a:hover { color: var(--c-blue); }

.site-footer__bottom {
    border-top: 1px solid var(--c-line);
    padding: 14px var(--gutter);
    text-align: center;
    font-size: 12px;
    color: var(--c-muted);
}

/* ---------- 400px+ ---------- */
@media (min-width: 400px) {
    .brand__logo { height: 32px; }
}

/* ---------- 470px+ ---------- */
@media (min-width: 470px) {
    .hero__title { font-size: 24px; }
    .site-footer__inner { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 768px+ ---------- */
@media (min-width: 768px) {
    :root { --gutter: 20px; --header-h: 64px; }

    .hero { padding: 28px 0 8px; }
    .hero__title { font-size: 28px; }

    .promo__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 18px 22px;
    }

    .site-footer__inner { grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; }
    .site-footer__brand { grid-column: auto; }
}

/* ---------- 1024px+ : inline nav, no burger ---------- */
@media (min-width: 1024px) {
    .brand { margin-right: 12px; }
    .brand__logo { height: 34px; }

    .site-nav {
        display: flex;
        position: static;
        flex-direction: row;
        flex: 1;
        gap: 2px;
        padding: 0;
        background: none;
        box-shadow: none;
    }

    .site-nav__link { padding: 8px 12px; font-size: 14px; }
    .site-nav__link--back { margin-left: auto; color: rgba(255, 255, 255, .7); }
    .site-nav__link--account { background: rgba(255, 255, 255, .1); }

    .menu-toggle { display: none; }
}

/* 9. Testing-period bar and footer "coming soon" items -------------------------- */
.site-notice {
    margin: 0;
    padding: 9px var(--gutter);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
}
.site-notice a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.site-notice--info { background: #e8eef9; color: var(--c-navy); }
.site-notice--festive { background: linear-gradient(90deg, #7a1f3d, #b8325a, #7a1f3d); color: #fff; }
.site-notice--success { background: #e7f6ec; color: #14532d; }
.site-notice--alert { background: #fdecec; color: #991b1b; }

.site-footer__soon { color: var(--c-muted); font-size: 14px; }
.site-footer__credit { font-size: 12px; }
.site-footer__credit a { color: inherit; }

/* One-line error note under the header (e.g. Google sign-in cancelled, form expired) */
.flash-bar { margin: 0; padding: 10px 16px; background: #fdecea; color: #a8261b; font-size: 14px; font-weight: 600; text-align: center; }

/* Footer social icons (Admin → SEO & Tracking → Social links) */
.site-footer__social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.site-footer__social a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--c-navy); color: #fff; transition: background .15s; }
.site-footer__social a:hover { background: var(--c-gold); color: var(--c-navy); }
.site-footer__social svg { width: 18px; height: 18px; fill: currentColor; }

/* Error pages (404, 500 …) — resources/views/errors */
.error-body { display: flex; flex-direction: column; min-height: 100vh; }
.error-page { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px 20px; text-align: center; }
.error-page__code { margin: 0; font-size: 72px; font-weight: 800; line-height: 1; color: var(--c-gold); }
.error-page__title { margin: 0; font-size: 26px; color: var(--c-navy); }
.error-page__text { margin: 0 0 10px; max-width: 460px; color: var(--c-muted); }
.error-page__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
