/* Search alerts (js/search-alerts.js): the "Alert me" button next to the selected filters
   on conference_advanced_search.html and its pop-up. */

.search-alert-button {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 32px;
    box-sizing: border-box;
    padding: 0 0.95rem 0 0.8rem;
    margin-left: auto;
    border: 1.5px solid #3eb3a5;
    border-radius: 999px;
    background: #fff;
    color: #0d6d6c;
    font: 600 0.85rem/1 'Inter', -apple-system, 'Segoe UI', sans-serif;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.search-alert-button:hover {
    background: #e9f7f5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -4px rgba(13, 109, 108, 0.35);
}

.search-alert-button:active {
    transform: translateY(0) scale(0.98);
}

.search-alert-button:focus-visible {
    outline: 2px solid #11a191;
    outline-offset: 2px;
}

.search-alert-button-icon {
    width: 16px;
    height: 16px;
    flex: none;
    transform-origin: 50% 2px;
}

.search-alert-button:hover .search-alert-button-icon {
    animation: saBellRing 0.6s ease;
}

.search-alert-button.is-idle {
    border-color: #d3e3e0;
    color: #5f7b77;
}

.search-alert-button.is-idle:hover {
    border-color: #3eb3a5;
    color: #0d6d6c;
}

.search-alert-button.is-on {
    border-color: transparent;
    background: linear-gradient(135deg, #11a191, #0d6d6c);
    color: #fff;
    box-shadow: 0 4px 14px -6px rgba(13, 109, 108, 0.6);
}

.search-alert-button.is-on:hover {
    background: linear-gradient(135deg, #13b09f, #0b5f5e);
}

/* Signed out: locked until the visitor signs in (a padlock replaces the bell) */
.search-alert-button.is-locked {
    border-color: #d3e3e0;
    background: #f6fbfa;
    color: #5f7b77;
}

.search-alert-button.is-locked:hover {
    border-color: #3eb3a5;
    background: #e9f7f5;
    color: #0d6d6c;
}

.search-alert-button.is-locked .search-alert-button-icon,
.search-alert-button.is-locked:hover .search-alert-button-icon {
    animation: none;
}

@keyframes saBellRing {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(14deg); }
    40% { transform: rotate(-12deg); }
    60% { transform: rotate(8deg); }
    80% { transform: rotate(-4deg); }
}

@media (max-width: 768px) {
    .search-alert-button {
        height: 36px;
        border-radius: 20px;
    }
}

/* ------------------------------------------------------------------ the pop-up */

html.sa-open,
html.sa-open body {
    overflow: hidden;
}

.sa-overlay {
    position: fixed;
    inset: 0;
    z-index: 100005;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(12, 31, 30, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.2s ease;
    font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
    color: #374151;
}

.sa-overlay[hidden] {
    display: none;
}

.sa-overlay.is-visible {
    opacity: 1;
}

.sa-dialog {
    position: relative;
    width: min(520px, 100%);
    max-height: min(780px, calc(100vh - 48px));
    max-height: min(780px, calc(100dvh - 48px));
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 30px 70px -24px rgba(12, 40, 38, 0.45), 0 0 0 1px rgba(13, 109, 108, 0.06);
    overflow: hidden;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.sa-overlay.is-visible .sa-dialog {
    transform: none;
}

.sa-dialog::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, #11a191, #3eb3a5 50%, #8b9cf7);
}

.sa-icon {
    width: 18px;
    height: 18px;
    flex: none;
}

/* Header */
.sa-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 26px 24px 16px;
}

.sa-head-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #e6f7f5, #eef0fe);
    color: #0d6d6c;
}

.sa-head-icon .sa-icon {
    width: 22px;
    height: 22px;
}

.sa-head-text {
    flex: 1;
    min-width: 0;
}

.sa-head h2 {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.2;
    color: #111827;
}

.sa-head p {
    margin: 4px 0 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #6b7280;
}

.sa-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: none;
    margin: -4px -6px 0 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sa-close:hover {
    background: #f1f5f4;
    color: #111827;
}

/* Tabs */
.sa-tabs {
    display: flex;
    gap: 4px;
    margin: 0 24px;
    padding: 4px;
    border-radius: 12px;
    background: #f1f6f5;
}

.sa-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #5f6f6d;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.sa-tab:hover {
    color: #0d6d6c;
}

.sa-tab.is-active {
    background: #fff;
    color: #0d6d6c;
    box-shadow: 0 1px 3px rgba(13, 60, 58, 0.12);
}

.sa-tab-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #d6efeb;
    color: #0d6d6c;
    font-size: 0.72rem;
    line-height: 20px;
}

.sa-tab-count[hidden] {
    display: none;
}

/* Panel */
.sa-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 24px 24px;
}

.sa-dialog.is-busy .sa-panel {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.15s ease 0.1s;
}

.sa-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0d6d6c;
}

.sa-fine {
    margin: 8px 0 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #6b7280;
}

/* The search being saved */
.sa-search-card {
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f2fbfa, #f5f6ff);
    border: 1px solid #dcefeb;
}

.sa-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sa-chip {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 999px;
    background: #3eb3a5;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
}

.sa-chip--topic {
    background: #0d6d6c;
}

.sa-chip--search {
    background: #fff;
    color: #0d6d6c;
    box-shadow: inset 0 0 0 1px #bfe3dd;
}

.sa-count {
    margin: 12px 0 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: #4b5563;
}

.sa-count b {
    color: #111827;
}

/* Form */
.sa-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sa-field {
    display: block;
}

.sa-field input[type="text"],
.sa-rename input {
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid #d6e2e0;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sa-field input[type="text"]:focus,
.sa-rename input:focus {
    outline: none;
    border-color: #3eb3a5;
    box-shadow: 0 0 0 4px rgba(62, 179, 165, 0.16);
}

/* Delivery choice */
.sa-delivery {
    display: grid;
    gap: 8px;
}

.sa-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1.5px solid #e3ebea;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.sa-option:hover {
    border-color: #b8ddd7;
}

.sa-option.is-checked {
    border-color: #3eb3a5;
    background: #f2fbfa;
}

.sa-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.sa-option:focus-within {
    box-shadow: 0 0 0 4px rgba(62, 179, 165, 0.18);
}

.sa-option-dot {
    width: 18px;
    height: 18px;
    flex: none;
    box-sizing: border-box;
    border: 2px solid #b9c9c6;
    border-radius: 50%;
    background: #fff;
    transition: border 0.15s ease;
}

.sa-option.is-checked .sa-option-dot {
    border: 5.5px solid #11a191;
}

.sa-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sa-option-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #111827;
}

.sa-option-sub {
    font-size: 0.8rem;
    color: #6b7280;
}

.sa-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e0f4f1;
    color: #0d6d6c;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: 1px;
}

/* What an alert covers */
.sa-benefits {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sa-benefits li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    line-height: 1.4;
    color: #4b5563;
}

.sa-benefits b {
    color: #111827;
    font-weight: 600;
}

.sa-benefit-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 10px;
}

.sa-benefit-icon .sa-icon {
    width: 16px;
    height: 16px;
}

.sa-benefit-icon--new {
    background: #e6f7f5;
    color: #0d6d6c;
}

.sa-benefit-icon--change {
    background: #fff4e6;
    color: #b45309;
}

.sa-benefit-icon--mail {
    background: #eef0fe;
    color: #4f5bd5;
}

/* Buttons */
.sa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.sa-btn:focus-visible,
.sa-tab:focus-visible,
.sa-close:focus-visible,
.sa-tool:focus-visible,
.sa-link:focus-visible,
.sa-alert-name:focus-visible,
.sa-add:focus-visible {
    outline: 2px solid #11a191;
    outline-offset: 2px;
}

.sa-btn--primary {
    background: linear-gradient(135deg, #11a191, #0d6d6c);
    color: #fff;
    box-shadow: 0 8px 20px -10px rgba(13, 109, 108, 0.8);
}

.sa-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -10px rgba(13, 109, 108, 0.85);
}

.sa-btn--ghost {
    background: #f1f6f5;
    color: #0d6d6c;
}

.sa-btn--ghost:hover {
    background: #e3efed;
}

.sa-btn--danger {
    background: #dc4c5a;
    color: #fff;
}

.sa-btn--danger:hover {
    background: #c43c4a;
}

.sa-btn--wide {
    width: 100%;
}

.sa-btn--small {
    height: 34px;
    padding: 0 14px;
    font-size: 0.82rem;
}

.sa-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}

/* Signed out */
.sa-intro {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sa-intro .sa-fine {
    margin-top: -10px;
    text-align: center;
}

/* Empty, error and done states */
.sa-empty,
.sa-done {
    padding: 18px 8px 8px;
    text-align: center;
}

.sa-empty--compact {
    padding: 10px 8px 4px;
}

.sa-empty-icon,
.sa-done-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, #e6f7f5, #eef0fe);
    color: #0d6d6c;
}

.sa-empty-icon .sa-icon {
    width: 26px;
    height: 26px;
}

.sa-done-icon {
    border-radius: 50%;
    background: linear-gradient(135deg, #11a191, #0d6d6c);
    color: #fff;
    box-shadow: 0 10px 24px -10px rgba(13, 109, 108, 0.8);
    animation: saPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sa-done-icon .sa-icon {
    width: 28px;
    height: 28px;
    stroke-width: 2.6;
}

.sa-empty h3,
.sa-done h3 {
    margin: 14px 0 6px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.sa-empty p,
.sa-done p {
    max-width: 380px;
    margin: 0 auto;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #4b5563;
}

.sa-empty .sa-btn {
    margin-top: 18px;
}

.sa-done .sa-fine {
    margin-top: 8px;
}

@keyframes saPop {
    from { transform: scale(0.4); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Already saved */
.sa-saved {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sa-saved-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #e9f7f5;
    color: #0d6d6c;
}

.sa-saved-banner.is-paused {
    background: #f4f5f7;
    color: #4b5563;
}

.sa-saved-banner div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
    line-height: 1.45;
}

.sa-saved-banner b {
    font-size: 0.95rem;
}

.sa-saved-banner span:not(.sa-saved-icon) {
    color: #4b5563;
}

.sa-saved-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 50%;
    background: #fff;
}

/* The list */
.sa-add {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1.5px dashed #9fd6ce;
    border-radius: 14px;
    background: #f6fcfb;
    color: #0d6d6c;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.sa-add span {
    flex: 1;
}

.sa-add:hover {
    border-color: #3eb3a5;
    background: #ecf8f6;
}

.sa-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sa-alert {
    padding: 14px 16px 12px;
    border: 1px solid #e3ebea;
    border-radius: 16px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sa-alert:hover {
    border-color: #cfe5e1;
    box-shadow: 0 6px 18px -12px rgba(13, 60, 58, 0.35);
}

.sa-alert.is-paused {
    background: #fafbfb;
}

.sa-alert.is-paused .sa-chips,
.sa-alert.is-paused .sa-alert-name {
    opacity: 0.6;
}

.sa-alert-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.sa-alert-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.98rem;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
}

.sa-alert-name:hover {
    color: #0d6d6c;
}

.sa-badge {
    flex: none;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.sa-badge--paused {
    background: #eef0f2;
    color: #6b7280;
}

.sa-badge--news {
    background: #fff4e6;
    color: #b45309;
}

.sa-alert .sa-chip {
    padding: 4px 9px;
    font-size: 0.75rem;
}

.sa-alert-meta {
    margin-top: 10px;
    font-size: 0.78rem;
    color: #6b7280;
}

.sa-alert-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 34px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f3f3;
}

.sa-alert-tools {
    display: inline-flex;
    gap: 4px;
}

.sa-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #0d6d6c;
    text-decoration: none;
    white-space: nowrap;
}

.sa-link .sa-icon {
    width: 15px;
    height: 15px;
    transition: transform 0.15s ease;
}

.sa-link:hover .sa-icon {
    transform: translateX(3px);
}

.sa-tool {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sa-tool .sa-icon {
    width: 16px;
    height: 16px;
}

.sa-tool:hover {
    background: #eef6f5;
    color: #0d6d6c;
}

.sa-tool--danger:hover {
    background: #fdecee;
    color: #c43c4a;
}

.sa-confirm-text {
    font-size: 0.86rem;
    font-weight: 600;
    color: #c43c4a;
}

.sa-alert-actions .sa-alert-tools .sa-btn {
    margin-left: 4px;
}

.sa-rename {
    flex: 1;
    display: flex;
    gap: 6px;
    min-width: 0;
}

.sa-rename input {
    flex: 1;
    min-width: 0;
    height: 34px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.sa-limit {
    text-align: right;
}

.sa-settings {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #edf1f1;
}

.sa-settings h3 {
    margin: 0 0 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0d6d6c;
}

/* Loading */
.sa-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.sa-spinner {
    width: 20px;
    height: 20px;
    flex: none;
    box-sizing: border-box;
    border: 2.5px solid #d6efeb;
    border-top-color: #11a191;
    border-radius: 50%;
    animation: saSpin 0.8s linear infinite;
}

.sa-spinner--small {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    border-width: 2px;
    vertical-align: -2px;
}

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

/* Status line */
.sa-status {
    max-height: 0;
    overflow: hidden;
    padding: 0 24px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    transition: max-height 0.2s ease, padding 0.2s ease;
}

.sa-status.is-shown {
    max-height: 80px;
    padding: 11px 24px;
}

.sa-status.is-ok {
    background: #e9f7f5;
    color: #0d6d6c;
}

.sa-status.is-error {
    background: #fdecee;
    color: #b42335;
}

/* Phones: a sheet from the bottom */
@media (max-width: 600px) {
    .sa-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .sa-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        border-radius: 22px 22px 0 0;
        transform: translateY(40px);
    }

    .sa-head {
        padding: 22px 18px 14px;
    }

    .sa-tabs {
        margin: 0 18px;
    }

    .sa-panel {
        padding: 18px 18px calc(22px + env(safe-area-inset-bottom, 0px));
    }

    .sa-head h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 380px) {
    .sa-head p {
        display: none;
    }

    .sa-head {
        align-items: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sa-overlay,
    .sa-dialog,
    .search-alert-button,
    .sa-done-icon,
    .search-alert-button:hover .search-alert-button-icon {
        transition: none;
        animation: none;
    }
}
