/* ==========================================================================
   Per-firm Deal Alerts
   - .firm-deal-alert-btn          (compact bell button on cards / deals page)
   - .firm-deal-alert-popover      (anchored popover form opened by the bell)
   - .firm-deal-alert-card         (prominent inline card on firm show page)

   Theme: white-card on purple gradient. Bell uses an amber accent so it
   stands out from the green/violet "Visit" CTAs without competing for the
   primary action role.
   ========================================================================== */

/* ------------- Bell trigger button -------------- */
.firm-deal-alert-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.firm-deal-alert-btn i {
    font-size: 14px;
    color: #f59e0b;
}
.firm-deal-alert-btn:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #78350f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18);
}
.firm-deal-alert-btn:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}
.firm-deal-alert-btn.is-subscribed {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}
.firm-deal-alert-btn.is-subscribed i {
    color: #10b981;
}
.firm-deal-alert-btn--pill {
    padding: 8px 14px;
    font-size: 13px;
}

@media (max-width: 560px) {
    .firm-deal-alert-btn__text {
        display: none;
    }
    .firm-deal-alert-btn {
        padding: 6px 9px;
    }
}

/* ------------- Popover (anchored by JS) -------------- */
.firm-deal-alert-popover {
    position: absolute;
    z-index: 10500;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: #fff;
    color: #1a1a2e;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    padding: 16px 16px 14px;
    font-size: 14px;
    animation: firmDealAlertPopIn 0.18s ease both;
}
@keyframes firmDealAlertPopIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.firm-deal-alert-popover::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
}
.firm-deal-alert-popover__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    color: #1a1a2e;
    margin-bottom: 6px;
}
.firm-deal-alert-popover__title i {
    color: #f59e0b;
    font-size: 18px;
}
.firm-deal-alert-popover__sub {
    font-size: 12.5px;
    color: #555;
    line-height: 1.45;
    margin-bottom: 10px;
}
.firm-deal-alert-popover__form {
    display: flex;
    gap: 6px;
}
.firm-deal-alert-popover__input {
    flex: 1 1 auto;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 13.5px;
    color: #1a1a2e;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.firm-deal-alert-popover__input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.firm-deal-alert-popover__btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
}
.firm-deal-alert-popover__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.32);
}
.firm-deal-alert-popover__btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}
.firm-deal-alert-popover__msg {
    margin-top: 8px;
    min-height: 0;
}
.firm-deal-alert-popover__alert {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.4;
}
.firm-deal-alert-popover__alert i {
    font-size: 16px;
    margin-top: 1px;
}
.firm-deal-alert-popover__alert.is-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.firm-deal-alert-popover__alert.is-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.firm-deal-alert-popover__close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 6px;
}
.firm-deal-alert-popover__close:hover {
    color: #1a1a2e;
}

/* ------------- Inline card (firm show page) -------------- */
.firm-deal-alert-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 18px 20px;
    margin: 22px 0;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.08);
    position: relative;
    overflow: hidden;
}
.firm-deal-alert-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.55) 0%, rgba(255, 255, 255, 0) 65%);
    pointer-events: none;
    border-radius: 14px;
}
.firm-deal-alert-card__icon {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.28);
    z-index: 1;
}
.firm-deal-alert-card__body {
    flex: 1 1 auto;
    min-width: 0;
    z-index: 1;
}
.firm-deal-alert-card__heading {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
    margin-bottom: 4px;
}
.firm-deal-alert-card__sub {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 12px;
}
.firm-deal-alert-card__form {
    display: flex;
    gap: 8px;
}
.firm-deal-alert-card__input {
    flex: 1 1 auto;
    min-width: 0;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    color: #1a1a2e;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.firm-deal-alert-card__input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.firm-deal-alert-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
}
.firm-deal-alert-card__btn i {
    font-size: 16px;
}
.firm-deal-alert-card__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.34);
}
.firm-deal-alert-card__btn:disabled {
    opacity: 0.75;
    cursor: wait;
    transform: none;
}
.firm-deal-alert-card__msg {
    margin-top: 10px;
}
.firm-deal-alert-card__alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
}
.firm-deal-alert-card__alert i {
    font-size: 18px;
    margin-top: 1px;
}
.firm-deal-alert-card__alert.is-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.firm-deal-alert-card__alert.is-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@media (max-width: 640px) {
    .firm-deal-alert-card {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }
    .firm-deal-alert-card__icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .firm-deal-alert-card__form {
        flex-direction: column;
    }
    .firm-deal-alert-card__btn {
        justify-content: center;
    }
}
