/* Notifications: the opt-in card (it borrows the install card's look from motion.css), the profile's settings, the admin
   announcement and campaign pages, and the signed-out unsubscribe page. */

/* ---------- Opt-in card ---------- */

.sk-push-bell {
    display: grid;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: calc(12px * var(--sc-radius-scale, 1));
    background: var(--sc-gradient-primary);
    color: var(--sc-on-primary);
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    animation: sk-push-ring 2.4s ease-in-out 600ms 2;
}

.sk-push-error {
    margin-top: 4px;
    color: var(--sc-warning);
    font-size: 12px;
}

@keyframes sk-push-ring {
    0%, 30%, 100% { transform: rotate(0); }
    6% { transform: rotate(14deg); }
    12% { transform: rotate(-12deg); }
    18% { transform: rotate(8deg); }
    24% { transform: rotate(-5deg); }
}

.sk-install-push {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    color: var(--sc-text);
    font-size: 13px;
    cursor: pointer;
}

/* ---------- Switches ---------- */

.sk-switch {
    position: relative;
    flex: none;
    width: 44px;
    height: 26px;
    margin: 0;
    border-radius: 999px;
    background: var(--sc-surface-3);
    box-shadow: inset 0 0 0 1px var(--sc-line-strong);
    cursor: pointer;
    transition: background 160ms ease;
    appearance: none;
    -webkit-appearance: none;
}

.sk-switch::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: transform 180ms var(--sc-ease-spring, ease);
    content: "";
}

.sk-switch:checked { background: var(--sc-primary); }
.sk-switch:checked::after { transform: translateX(18px); }
.sk-switch:disabled { opacity: 0.45; cursor: not-allowed; }
.sk-switch:focus-visible { outline: 2px solid var(--sc-azure); outline-offset: 2px; }

.sk-switch.is-small { width: 36px; height: 22px; }
.sk-switch.is-small::after { width: 16px; height: 16px; }
.sk-switch.is-small:checked::after { transform: translateX(14px); }

.sk-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 8px 0;
    color: var(--sc-text);
    font-family: inherit;
    letter-spacing: normal;
    text-transform: none;
    cursor: pointer;
}

.sk-switch-row * { text-transform: none; letter-spacing: normal; }

.sk-switch-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
}

.sk-switch-text small {
    color: var(--sc-text-muted);
    font-size: 12px;
    font-weight: 400;
}

.sk-switch-row.is-kind .sk-switch-text { font-weight: 500; }

/* ---------- Profile settings ---------- */

.sk-notify {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--sc-line-strong);
    border-radius: calc(14px * var(--sc-radius-scale, 1));
    background: rgba(var(--sc-bg-rgb), 0.7);
}

.sk-notify-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.sk-notify-icon {
    color: var(--sc-primary);
    font-size: 22px;
}

.sk-notify-title {
    font-weight: 700;
    font-size: 14px;
}

.sk-notify-kinds {
    margin: 4px 0 0;
    padding: 2px 0 2px 12px;
    border-left: 2px solid var(--sc-line-strong);
}

.sk-notify-note {
    margin: 4px 0;
    color: var(--sc-text-muted);
    font-size: 13px;
}

.sk-notify-note.small { font-size: 12px; }
.sk-notify-note b { color: var(--sc-text); }
.sk-notify-note ion-icon { vertical-align: -2px; }

.sk-notify-error {
    margin: 4px 0;
    color: var(--sc-warning);
    font-size: 13px;
}

.sk-notify-email {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--sc-line);
}

/* ---------- Admin ---------- */

.apush-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

.apush-count {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--sc-surface-2);
    color: var(--sc-text-muted);
    font-size: 13px;
}

.apush-count b { color: var(--sc-text); }

.apush-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--sc-text-muted);
}

.apush-body { min-height: 180px; font-family: inherit; }

.apush-hint {
    margin: -4px 0 10px;
    color: var(--sc-text-faint);
    font-size: 12px;
}

.apush-hint code { color: var(--sc-text-muted); }

.apush-preview-phone {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    color: #111;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.apush-preview-phone img { width: 36px; height: 36px; border-radius: 9px; }
.apush-preview-phone strong { display: block; font-size: 14px; }
.apush-preview-phone span { font-size: 13px; color: #333; }
.apush-preview-phone small { display: block; color: #777; font-size: 11px; }

/* The campaign preview mimics the email (whose own styles are inline) */
.acamp-preview {
    padding: 16px;
    border-radius: 18px;
    background: #051029;
    color: #e8f0ff;
    font: 15px/1.5 Arial, sans-serif;
    overflow-wrap: anywhere;
}

.acamp-preview-subject {
    margin: 0 0 10px;
    color: var(--sc-text-muted);
    font-size: 13px;
}

.acamp-progress {
    height: 8px;
    margin: 8px 0;
    border-radius: 999px;
    background: var(--sc-surface-3);
    overflow: hidden;
}

.acamp-progress > span {
    display: block;
    height: 100%;
    background: var(--sc-gradient-primary);
    transition: width 300ms ease;
}

.acamp-history {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.acamp-history th,
.acamp-history td {
    padding: 6px 4px;
    border-bottom: 1px solid var(--sc-line);
    text-align: left;
    vertical-align: top;
}

.acamp-history th { color: var(--sc-text-muted); font-weight: 600; }
.acamp-history td.num { text-align: right; white-space: nowrap; }

/* ---------- Unsubscribe page ---------- */

.unsub-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 420px;
    margin: 48px max(16px, calc((100% - 420px) / 2));
    padding: 28px 20px;
    border: 1px solid var(--sc-line-strong);
    border-radius: var(--sc-radius-lg, 22px);
    background: rgba(var(--sc-surface-rgb), 0.85);
    text-align: center;
}

.unsub-page img { width: 64px; height: 64px; border-radius: 16px; }
.unsub-page h1 { margin: 0; font-family: var(--sc-font-display); font-size: 24px; }
.unsub-page p { margin: 0; color: var(--sc-text-muted); }

@media (prefers-reduced-motion: reduce) {
    .sk-push-bell { animation: none; }
    .sk-switch, .sk-switch::after { transition: none; }
}
