/* =========================================================================
   ibgib — privacy-policy.css
   Scoped styles for <ibgib-privacy-policy> Web Component.
   Inherits CSS custom properties from the host application.
   ========================================================================= */

:host {
    display: block;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    color: var(--clr-text-primary, #e8f0e8);
    font-family: var(--font-sans, system-ui, sans-serif);
    line-height: 1.6;
    box-sizing: border-box;
}

.privacy-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    box-sizing: border-box;
}

/* ── Header ── */
.privacy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.25rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--clr-border, rgba(120, 248, 126, 0.12));
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--clr-text-secondary, #8fa08f);
    background: var(--clr-bg-glass, rgba(11, 17, 32, 0.7));
    border: 1px solid var(--clr-border, rgba(120, 248, 126, 0.12));
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: all var(--t-fast, 120ms ease);
}

.btn-back:hover {
    color: var(--clr-text-primary, #ffffff);
    border-color: var(--clr-border-hover, rgba(120, 248, 126, 0.32));
    background: var(--clr-accent-glow, rgba(120, 248, 126, 0.15));
}

.privacy-badge {
    font-size: 0.85rem;
    color: var(--clr-accent, #78f87e);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm, 6px);
    background: var(--clr-accent-glow, rgba(120, 248, 126, 0.1));
    border: 1px solid var(--clr-border, rgba(120, 248, 126, 0.15));
}

/* ── Loading State ── */
.privacy-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    gap: 1rem;
    color: var(--clr-text-secondary, #8fa08f);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--clr-border, rgba(120, 248, 126, 0.15));
    border-top-color: var(--clr-accent, #78f87e);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Error State ── */
.privacy-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 1rem;
    color: var(--clr-danger, #ff5b5b);
    background: rgba(255, 91, 91, 0.08);
    border: 1px solid rgba(255, 91, 91, 0.25);
    border-radius: var(--radius-md, 12px);
    margin: 2rem 0;
}

.btn-retry {
    padding: 0.4rem 1rem;
    font-size: 0.88rem;
    color: var(--clr-text-primary, #ffffff);
    background: var(--clr-danger, #ff5b5b);
    border: none;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
}

/* ── Markdown Rendered Typography ── */
.privacy-content {
    display: block;
}

.privacy-content .policy-title {
    font-size: 2.2rem;
    color: var(--clr-text-primary, #ffffff);
    margin-top: 0;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}

.privacy-content .policy-h2 {
    font-size: 1.35rem;
    color: var(--clr-accent, #78f87e);
    margin-top: 2.25rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--clr-border, rgba(120, 248, 126, 0.12));
}

.privacy-content .policy-h3 {
    font-size: 1.1rem;
    color: var(--clr-text-primary, #e8f0e8);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.privacy-content .policy-h4 {
    font-size: 0.95rem;
    color: var(--clr-text-secondary, #8fa08f);
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
}

.privacy-content p {
    color: var(--clr-text-primary, #e8f0e8);
    font-size: 0.95rem;
    margin: 0.75rem 0;
}

.privacy-content ul,
.privacy-content ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0 1rem;
}

.privacy-content li {
    color: var(--clr-text-primary, #e8f0e8);
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.privacy-content code {
    font-family: var(--font-mono, monospace);
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    color: var(--clr-accent, #78f87e);
}

.privacy-content code.math {
    color: var(--clr-info, #44aaff);
}

.privacy-content a {
    color: var(--clr-accent, #78f87e);
    text-decoration: underline;
    transition: color var(--t-fast, 120ms ease);
}

.privacy-content a:hover {
    color: var(--clr-border-hover, #a6fca9);
}

.privacy-content .divider {
    border: 0;
    border-top: 1px solid var(--clr-border, rgba(120, 248, 126, 0.12));
    margin: 2.25rem 0;
}

/* ── Alert Boxes ── */
.privacy-content .alert-box {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm, 6px);
    margin: 1.25rem 0;
    align-items: flex-start;
    border: 1px solid var(--clr-border, rgba(120, 248, 126, 0.12));
    background: var(--clr-bg-glass, rgba(11, 17, 32, 0.7));
}

.privacy-content .alert-warning {
    background: rgba(255, 204, 68, 0.08);
    border-color: rgba(255, 204, 68, 0.3);
    color: var(--clr-warn, #ffcc44);
}

.privacy-content .alert-important {
    background: rgba(68, 170, 255, 0.08);
    border-color: rgba(68, 170, 255, 0.3);
    color: var(--clr-info, #44aaff);
}

.privacy-content .alert-note {
    background: rgba(120, 248, 126, 0.08);
    border-color: rgba(120, 248, 126, 0.3);
    color: var(--clr-accent, #78f87e);
}

.privacy-content .alert-icon {
    font-size: 1.2rem;
    line-height: 1.2;
}

.privacy-content .alert-body {
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--clr-text-primary, #e8f0e8);
}

/* ── Footer ── */
.privacy-footer {
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--clr-border, rgba(120, 248, 126, 0.12));
    font-size: 0.85rem;
    color: var(--clr-text-secondary, #8fa08f);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.privacy-footer a {
    color: var(--clr-accent, #78f87e);
    text-decoration: none;
}

.privacy-footer a:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}
