/*
 * Shared styles for the legal pages (privacy policies, child safety standards).
 *
 * These pages are plain HTML + this one stylesheet, with no Tailwind, so they load fast
 * and stay readable even if a CDN is down. Colors and font match the home page
 * (index.html): dark slate background, violet accent, sky-blue links, Inter font.
 */

:root {
    --bg: #0f172a;          /* page background (slate 900), same as index.html */
    --surface: #1e293b;     /* cards and header (slate 800) */
    --border: rgba(255, 255, 255, 0.08);
    --text: #f8fafc;        /* headings */
    --text-body: #cbd5e1;   /* paragraph text (slate 300), softer for long reading */
    --text-muted: #94a3b8;  /* dates, footer (slate 400) */
    --accent: #8b5cf6;      /* brand violet */
    --link: #38bdf8;        /* brand sky blue */
    --link-hover: #7dd3fc;
    --radius: 16px;
}

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

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

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

a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: rgba(56, 189, 248, 0.4);
    text-underline-offset: 3px;
    overflow-wrap: anywhere; /* long URLs and emails must not cause sideways scrolling on phones */
}

a:hover {
    color: var(--link-hover);
    text-decoration-color: currentColor;
}

/* Visible keyboard focus ring for accessibility */
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Hidden until focused: lets keyboard users jump straight past the header */
.skip-link {
    position: absolute;
    left: 16px;
    top: -100px;
    padding: 12px 16px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    z-index: 100;
}

.skip-link:focus {
    top: 16px;
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-header .inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.01em;
    text-decoration: none;
    min-height: 48px; /* minimum touch target size */
}

.brand svg {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.brand .accent {
    color: var(--accent);
}

.back-link {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 4px;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.back-link:hover {
    color: var(--text);
}

/* ---------- Main document ---------- */

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 16px 64px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 16px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.document {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
}

@media (min-width: 640px) {
    main {
        padding-top: 64px;
    }

    .document {
        padding: 48px;
    }
}

.document h1 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.document h2 {
    margin: 40px 0 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text);
    font-size: 1.375rem;
    line-height: 1.3;
    font-weight: 700;
}

.document h3 {
    margin: 28px 0 8px;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
}

.document p {
    margin: 0 0 16px;
}

/* The first paragraph after the title holds the effective or updated date */
.document h1 + p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.document ul,
.document ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.document li {
    margin-bottom: 8px;
}

.document li > ul,
.document li > ol {
    margin-top: 8px;
}

.document li::marker {
    color: var(--accent);
}

.document strong {
    color: var(--text);
    font-weight: 600;
}

/* "In short" callout at the top of a policy (a bold label followed by a list) */
.summary-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.summary-box > strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
}

.summary-box ul {
    margin: 0;
    padding-left: 20px;
}

/* Data tables. Wrap each <table> in <div class="table-wrap"> so wide tables
   scroll sideways inside the card on phones instead of widening the page. */
.table-wrap {
    overflow-x: auto;
    margin: 16px 0 24px;
}

.document table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.925rem;
}

.document th,
.document td {
    text-align: left;
    vertical-align: top;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.document th {
    color: var(--text);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.4);
}

/* Inline technical terms, e.g. a permission name like drive.appdata */
.document code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875em;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
}

/* Links between an app's own pages (e.g. privacy policy <-> account deletion),
   shown at the bottom of the document card */
.related-links {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.related-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px; /* minimum touch target size */
}

/* ---------- Interactive panels (e.g. web account deletion) ---------- */

/* A boxed area inside the document that holds buttons and a form. */
.action-panel {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin: 0 0 24px;
    overflow-wrap: anywhere; /* long email addresses must not cause sideways scrolling on phones */
}

.action-panel p:last-child {
    margin-bottom: 0;
}

/* Make sure "hidden" always wins over the display rules below (e.g. flex rows). */
.action-panel [hidden] {
    display: none !important;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px; /* minimum touch target size */
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

/* Hover colours apply only to enabled buttons, so a disabled one doesn't look clickable. */
.button:hover:not(:disabled) {
    background: #7c3aed; /* violet 600, one step darker than the accent */
}

.button:focus-visible,
.action-panel input:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
}

.button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* For actions that can't be undone, such as deleting an account. */
.button-danger {
    background: #dc2626; /* red 600 */
}

.button-danger:hover:not(:disabled) {
    background: #b91c1c; /* red 700 */
}

/* Secondary choice next to a main button, e.g. Cancel. */
.button-quiet {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
}

.button-quiet:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
}

/* The "type DELETE to confirm" step. */
.confirm-box {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.confirm-box label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
}

.action-panel input[type="text"] {
    width: 100%;
    max-width: 320px;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    letter-spacing: 0.08em;
}

/* Error text shown under a panel. */
.form-message {
    margin: 16px 0 0;
    padding: 12px 14px;
    border: 1px solid rgba(248, 113, 113, 0.4);
    border-radius: 10px;
    background: rgba(220, 38, 38, 0.12);
    color: #fecaca; /* red 200: readable on the dark background */
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 16px 48px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.site-footer .inner {
    max-width: 800px;
    margin: 0 auto;
}

.site-footer h2 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
}

.site-footer ul {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
}

.site-footer li a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--text-muted);
    text-decoration: none;
}

.site-footer li a:hover,
.site-footer li a[aria-current="page"] {
    color: var(--text);
}

.site-footer p {
    margin: 0;
}

@media print {
    body {
        background: #fff;
        color: #000;
    }

    .site-header,
    .site-footer,
    .skip-link,
    .eyebrow {
        display: none;
    }

    .document {
        border: 0;
        padding: 0;
        background: none;
    }

    .document h1,
    .document h2,
    .document h3,
    .document strong {
        color: #000;
    }

    a {
        color: #000;
    }
}
