/* ============================================
   Privacy policy change notice
   Built by js/policy-change-notice.js, shown once at sign-in on the pages an
   account holder lands on. All classes use the rb- prefix. Colours come from the
   design-system.css tokens, with the same values as fallbacks; the dark
   surface is the one the step-up modal uses.
   ============================================ */

.rb-policy-notice-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.45);
    animation: rbPolicyNoticeFade 0.15s ease-out;
}

.rb-policy-notice-overlay *,
.rb-policy-notice-overlay *::before,
.rb-policy-notice-overlay *::after {
    box-sizing: border-box;
}

.rb-policy-notice {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 1.75rem;
    background: #ffffff;
    color: var(--rb-text-dark, #1f2937);
    border-radius: var(--rb-radius-xl, 20px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.04);
    font-family: var(--rb-font-body, 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    text-align: left;
    animation: rbPolicyNoticeRise 0.25s ease-out;
}

.rb-policy-notice:focus {
    outline: none;
}

.rb-policy-notice:focus-visible {
    outline: 2px solid var(--rb-purple-light, #8b5cf6);
    outline-offset: -2px;
}

.rb-policy-notice .rb-policy-notice-title {
    margin: 0 0 0.25rem;
    font-family: var(--rb-font-display, 'Instrument Serif', Georgia, serif);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.25;
    color: var(--rb-text-dark, #1f2937);
}

.rb-policy-notice .rb-policy-notice-date {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rb-text-light, #6b7280);
}

.rb-policy-notice .rb-policy-notice-intro {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--rb-text-dark, #1f2937);
}

.rb-policy-notice .rb-policy-notice-list {
    margin: 0 0 1rem;
    padding: 0 0 0 1.25rem;
    list-style: disc;
}

.rb-policy-notice .rb-policy-notice-list li {
    margin: 0 0 0.625rem;
    padding: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--rb-text-dark, #1f2937);
}

.rb-policy-notice .rb-policy-notice-list li:last-child {
    margin-bottom: 0;
}

/* Changes from an earlier update the account never saw (routes/privacy.js `earlier`). */
.rb-policy-notice .rb-policy-notice-earlier {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--rb-text-dark, #1f2937);
}

.rb-policy-notice .rb-policy-notice-link {
    margin: 0 0 0.5rem;
    font-size: 0.9375rem;
}

.rb-policy-notice .rb-policy-notice-link a {
    color: var(--rb-purple, #9333ea);
    font-weight: 600;
    text-decoration: underline;
}

.rb-policy-notice .rb-policy-notice-link a:focus-visible {
    outline: 2px solid var(--rb-purple-light, #8b5cf6);
    outline-offset: 2px;
    border-radius: 4px;
}

/* The dialog scrolls on a small screen, so the button stays in view: the row
   sticks to the bottom and covers the dialog's own bottom padding, on the
   dialog's background, so nothing jumps when the end is reached. */
.rb-policy-notice .rb-policy-notice-actions {
    position: sticky;
    bottom: -1.75rem;
    display: flex;
    justify-content: flex-end;
    margin: 0 -1.75rem -1.75rem;
    padding: 0.75rem 1.75rem 1.75rem;
    background: inherit;
}

/* The shared primary button, restated so a page's own button rules cannot restyle it. */
.rb-policy-notice .rb-policy-notice-ok {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: var(--rb-radius-md, 12px);
    background: var(--rb-brand-gradient, linear-gradient(135deg, #f97316 0%, #ea580c 50%, #9333ea 100%));
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.rb-policy-notice .rb-policy-notice-ok:focus-visible {
    outline: 2px solid var(--rb-purple-light, #8b5cf6);
    outline-offset: 2px;
}

.rb-policy-notice .rb-policy-notice-ok:disabled {
    opacity: 0.6;
    cursor: default;
}

[data-theme="dark"] .rb-policy-notice {
    background: #1e1b2e;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .rb-policy-notice .rb-policy-notice-link a {
    color: #a78bfa;
}

@keyframes rbPolicyNoticeFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes rbPolicyNoticeRise {
    from { transform: translateY(-16px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .rb-policy-notice-overlay,
    .rb-policy-notice {
        animation: none;
    }
}

@media (max-width: 480px) {
    .rb-policy-notice {
        padding: 1.25rem;
    }

    .rb-policy-notice .rb-policy-notice-actions {
        bottom: -1.25rem;
        justify-content: stretch;
        margin: 0 -1.25rem -1.25rem;
        padding: 0.75rem 1.25rem 1.25rem;
    }

    .rb-policy-notice .rb-policy-notice-ok {
        width: 100%;
    }
}
