/* ============================================================
   privacy-consent.css — Gemini data-sharing consent gate
   Requires: app.css (tokens load on the same page; this file is
   imported from app.css itself, so they always do).

   Shares the quota-alert visual language — same tokens, same card
   geometry — because both are "the app is stopping to tell you
   something" and two different-looking blockers read as two
   different products. It does NOT reuse the .qa-* classes: this
   dialog is wider, left-aligned, and has no close affordance, so
   sharing a selector would mean one file's change silently
   reshaping the other's dialog.
   ============================================================ */

:root {
    --pc-bg:      var(--glass-panel-solid);
    --pc-border:  var(--glass-line);
    --pc-accent:  var(--brand,          #1880c0);
    --pc-dim:     var(--brand-dim,      rgba(24,128,192,0.10));
    --pc-glow:    var(--brand-glow,     rgba(24,128,192,0.28));
    --pc-t1:      var(--text-primary,   #e8eaed);
    --pc-t2:      var(--text-secondary, #8aafc8);
    --pc-t3:      var(--text-tertiary,  #445f78);
    --pc-danger:  var(--danger,         #e0533f);
    --pc-t:       var(--t, 0.20s cubic-bezier(0.4,0,0.2,1));
}

/* ══ OVERLAY ════════════════════════════════════════════════ */
/* z-index above the quota alert (1500): if both ever resolve at once,
   the consent question is the one that has to be answered first —
   the other is about a plan, this one is about a legal basis. */
.pc-overlay {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--scrim);
    backdrop-filter: var(--scrim-blur);
    -webkit-backdrop-filter: var(--scrim-blur);
    animation: pcFade 0.16s ease-out;
    overflow-y: auto;
}
.pc-overlay[hidden] { display: none; }

/* The page behind a blocking dialog must not scroll under it. */
body.pc-locked { overflow: hidden; }

@keyframes pcFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pcRise {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

/* ══ CARD ═══════════════════════════════════════════════════ */
.pc-card {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: auto;                   /* centres, and scrolls when taller than the viewport */
    padding: 30px 28px 22px;
    background: var(--pc-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--pc-border);
    border-radius: var(--r-xl, 20px);
    box-shadow: var(--glass-highlight), var(--glass-shadow);
    text-align: start;              /* logical: reads correctly in both RTL and LTR */
    animation: pcRise 0.22s cubic-bezier(0.16,1,0.3,1);
}
.pc-card-sm { max-width: 420px; text-align: center; }

/* ══ ICON ═══════════════════════════════════════════════════ */
.pc-icon {
    display: flex; align-items: center; justify-content: center;
    width: 52px; height: 52px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--pc-dim);
    border: 1px solid rgba(24,128,192,0.22);
    color: var(--pc-accent);
    box-shadow: 0 0 22px var(--pc-glow);
}
.pc-icon svg { width: 25px; height: 25px; }
.pc-card-sm .pc-icon { margin-inline: auto; }

/* ══ COPY ═══════════════════════════════════════════════════ */
.pc-title {
    margin: 0 0 10px;
    font-size: 18px; font-weight: 600; line-height: 1.35;
    color: var(--pc-t1);
    text-wrap: balance;
}
.pc-intro {
    margin: 0 0 18px;
    font-size: 13.5px; line-height: 1.75;
    color: var(--pc-t2);
}
.pc-intro strong { color: var(--pc-t1); font-weight: 600; }

/* ══ DISCLOSURE FACTS ═══════════════════════════════════════ */
/* Three labelled blocks rather than a paragraph: the provider, the data
   and the purpose are the three things the disclosure has to make
   findable, and prose lets all three be skimmed past at once. */
.pc-facts {
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid var(--pc-border);
    border-radius: var(--r-md, 12px);
    background: rgba(255,255,255,0.02);
}
.pc-fact + .pc-fact {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--pc-border);
}
.pc-fact dt {
    margin: 0 0 5px;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--pc-t3);
}
.pc-fact dd {
    margin: 0;
    font-size: 13px; line-height: 1.7;
    color: var(--pc-t2);
}
.pc-list {
    margin: 0;
    padding-inline-start: 18px;     /* logical: the bullets sit on the right in RTL */
}
.pc-list li { margin-bottom: 3px; }

.pc-note {
    margin: 0 0 18px;
    padding: 11px 13px;
    border-radius: var(--r-sm, 8px);
    background: var(--pc-dim);
    border: 1px solid rgba(24,128,192,0.18);
    font-size: 12.5px; line-height: 1.7;
    color: var(--pc-t2);
}
.pc-note strong { color: var(--pc-t1); }

/* ══ ACTIONS ════════════════════════════════════════════════ */
.pc-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.pc-btn {
    flex: 1;
    padding: 11px 14px;
    border-radius: var(--r-md, 12px);
    font-family: inherit; font-size: 13px; font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--pc-t), border-color var(--pc-t), color var(--pc-t);
}
.pc-btn:disabled { opacity: 0.55; cursor: progress; }
.pc-btn-primary {
    flex: 2;                        /* agreeing is the common path, not the loud one */
    background: var(--pc-accent);
    border-color: var(--pc-accent);
    color: #fff;
    box-shadow: 0 4px 16px var(--pc-glow);
}
.pc-btn-primary:hover:not(:disabled) {
    background: var(--brand-light, #2a9ad6);
    border-color: var(--brand-light, #2a9ad6);
}
.pc-btn-ghost {
    background: rgba(255,255,255,0.03);
    border-color: var(--pc-border);
    color: var(--pc-t2);
}
.pc-btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.06); color: var(--pc-t1); }

.pc-error {
    margin: 0 0 8px;
    font-size: 12.5px; line-height: 1.6;
    color: var(--pc-danger);
}
.pc-error[hidden] { display: none; }

.pc-legal {
    margin: 0;
    font-size: 11.5px; line-height: 1.6;
    color: var(--pc-t3);
    text-align: center;
}
.pc-legal a { color: var(--pc-t2); text-decoration: underline; }
.pc-legal a:hover { color: var(--pc-t1); }

/* ══ SETTINGS PANEL (Profile ▸ Privacy) ═════════════════════ */
.pm-privacy-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
}
.pm-privacy-row + .pm-privacy-row { border-top: 1px solid var(--pc-border); }
.pm-privacy-copy { flex: 1; min-width: 0; }
.pm-privacy-name {
    display: block;
    margin-bottom: 3px;
    font-size: 13.5px; font-weight: 600;
    color: var(--pc-t1);
}
.pm-privacy-desc {
    margin: 0 0 4px;
    font-size: 12.5px; line-height: 1.65;
    color: var(--pc-t2);
}
.pm-privacy-state {
    display: block;
    font-size: 11.5px;
    color: var(--pc-t3);
}

/* Toggle: a checkbox styled as a switch, so it keeps the native
   keyboard and screen-reader behaviour a div never gets right. */
.pm-switch {
    position: relative;
    flex: 0 0 auto;
    width: 42px; height: 24px;
    margin-top: 2px;
}
.pm-switch input {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    margin: 0; opacity: 0; cursor: pointer;
    z-index: 1;
}
.pm-switch-track {
    display: block;
    width: 100%; height: 100%;
    border-radius: 9999px;
    background: rgba(255,255,255,0.10);
    border: 1px solid var(--pc-border);
    transition: background var(--pc-t), border-color var(--pc-t);
}
.pm-switch-track::after {
    content: '';
    position: absolute;
    top: 3px; inset-inline-start: 3px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--pc-t2);
    transition: transform var(--pc-t), background var(--pc-t);
}
.pm-switch input:checked ~ .pm-switch-track {
    background: var(--pc-accent);
    border-color: var(--pc-accent);
}
.pm-switch input:checked ~ .pm-switch-track::after {
    background: #fff;
    /* Logical direction: the knob travels toward the end of the line,
       which is leftward in Arabic and rightward in English. */
    transform: translateX(18px);
}
[dir="rtl"] .pm-switch input:checked ~ .pm-switch-track::after {
    transform: translateX(-18px);
}
.pm-switch input:focus-visible ~ .pm-switch-track {
    outline: 2px solid var(--pc-accent);
    outline-offset: 2px;
}
.pm-switch input:disabled { cursor: progress; }
.pm-switch input:disabled ~ .pm-switch-track { opacity: 0.55; }

/* "Download my data" row: sits below the erase button, so it draws its own
   divider rather than relying on the row + row rule. */
.pm-export-row {
    margin-top: 14px;
    border-top: 1px solid var(--pc-border);
}
.pm-export-actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.pm-export-actions [hidden] { display: none; }
.pm-export-actions a.pm-btn { text-align: center; text-decoration: none; }

/* ══ NARROW SCREENS ═════════════════════════════════════════ */
@media (max-width: 480px) {
    .pc-card    { padding: 24px 18px 18px; }
    .pc-actions { flex-direction: column; }
    .pc-btn     { width: 100%; flex: 1 1 auto; }
    .pm-export-row     { flex-direction: column; }
    .pm-export-actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .pc-overlay, .pc-card { animation: none; }
    .pc-btn, .pm-switch-track, .pm-switch-track::after { transition: none; }
}
