/* Depleted-quota signup modal — clean + on-brand (matches Chatbot_UI.css tokens).
   ponytail: flat card, one high-contrast CTA, muted dismiss; no glow/gradients. */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 6, 17, 0.72);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.modal-overlay[hidden] { display: none; }

.modal-content {
    background:
        url("./gold-eva-plain.png?v=3") no-repeat -230px -120px / 340px auto,
        url("./gold-eva.png?v=3") no-repeat 100% 210px / 62px auto,
        url("./gold-eva.png?v=3") no-repeat -8px 100% / 130px auto,
        radial-gradient(70% 60% at 82% 8%, rgba(255, 215, 0, 0.10), transparent 62%),
        radial-gradient(90% 60% at 50% 130%, rgba(96, 165, 250, 0.06), transparent 65%),
        #0d1220;
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 2rem 1.5rem;
    width: min(400px, 90%);
    text-align: center;
    box-shadow: var(--shadow-soft);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(8px);
    transition: transform 0.2s ease;
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* reward hero: flat gold mark + big number; no glow */
.reward-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.reward-orb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(255, 215, 0, 0.35);
    background: rgba(255, 215, 0, 0.1);
    color: var(--brand-gold);
}

.reward-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.reward-num {
    font-family: 'Poppins', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--brand-gold);
}

.reward-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--muted-ink);
    line-height: 1.3;
    text-align: center;
}

.modal-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    color: var(--ink);
    margin-bottom: 0.7rem;
}

.modal-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    color: var(--muted-ink);
    line-height: 1.55;
    margin-bottom: 1.5rem;
}

.modal-desc strong {
    color: var(--brand-gold);
    font-weight: 600;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

.primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-gold);
    color: #050a18;
    padding: 0.9rem 1.25rem;
    border: none;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    min-height: 48px;
    transition: filter 0.15s ease;
}

.primary-btn:hover {
    filter: brightness(1.06);
}

.secondary-btn {
    background: transparent;
    color: var(--muted-ink);
    padding: 0.5rem;
    min-height: 40px;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: color 0.15s ease;
}

.secondary-btn:hover {
    color: var(--ink);
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--muted-ink);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: color 0.15s ease;
}

.modal-close:hover,
body.light-mode .modal-close:hover {
    color: var(--ink);
}

/* craft: explicit focus states (WCAG 2.4.7) + consistent transition */
.modal-close,
.primary-btn,
.secondary-btn {
    transition: color 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.modal-close:focus-visible {
    outline: 2px solid var(--brand-gold);
    outline-offset: 2px;
    border-radius: 12px;
}

/* --- light mode --- */
body.light-mode .modal-content {
    background:
        url("./gold-eva-plain.png?v=3") no-repeat -230px -120px / 340px auto,
        url("./gold-eva.png?v=3") no-repeat 100% 210px / 62px auto,
        url("./gold-eva.png?v=3") no-repeat -8px 100% / 130px auto,
        radial-gradient(70% 60% at 82% 8%, rgba(255, 215, 0, 0.10), transparent 62%),
        radial-gradient(90% 60% at 50% 130%, rgba(148, 163, 184, 0.16), transparent 65%),
        #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

body.light-mode .reward-orb {
    border-color: rgba(180, 130, 0, 0.35);
    background: rgba(255, 215, 0, 0.18);
    color: #b45309;
}

body.light-mode .reward-num,
body.light-mode .modal-title {
    color: #0f172a;
}

body.light-mode .reward-num {
    color: #b45309;
}

body.light-mode .reward-label,
body.light-mode .modal-desc,
body.light-mode .modal-close,
body.light-mode .secondary-btn {
    color: #475569;
}

body.light-mode .modal-desc strong {
    color: #b45309;
}

body.light-mode .primary-btn {
    color: #ffffff;
    background: #b8860b;
}

body.light-mode .primary-btn:hover {
    filter: brightness(1.08);
}

body.light-mode .secondary-btn:hover,
body.light-mode .modal-close:hover {
    color: #0f172a;
}

/* credits pill is a purchase entry point (opens the token modal) */
.credits-pill {
    cursor: pointer;
}

.credits-pill:hover {
    filter: brightness(1.12);
}

.credits-pill:focus-visible {
    outline: 2px solid var(--brand-gold);
    outline-offset: 2px;
}

/* Feedback modal — wider card, left-aligned form fields. */
.feedback-content {
    width: min(460px, 92%);
    text-align: left;
    align-items: stretch;
}
.feedback-content .reward-hero {
    align-items: center;
}
.feedback-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}
.feedback-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted-ink);
}
.feedback-optional {
    font-weight: 400;
    opacity: 0.7;
}
.feedback-select,
.feedback-input,
.feedback-textarea {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    color: var(--ink);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
    outline: none;
    transition: border-color 0.15s ease;
}
.feedback-select:focus,
.feedback-input:focus,
.feedback-textarea:focus {
    border-color: var(--brand-gold);
}
.feedback-textarea {
    resize: vertical;
    min-height: 96px;
}
.feedback-status {
    font-size: 0.82rem;
    margin: 0 0 0.5rem;
}
.feedback-status.error {
    color: #ef4444;
}
.feedback-status.success {
    color: #22c55e;
}

/* Feedback consent — explicit Terms/Privacy agreement (required to submit). */
.feedback-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0 0 0.85rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--muted-ink);
}
.feedback-consent input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 0.15rem;
    width: 16px;
    height: 16px;
    accent-color: var(--brand-gold);
    cursor: pointer;
}
.feedback-consent a {
    color: var(--brand-gold);
    font-weight: 600;
    text-decoration: none;
}
.feedback-consent a:hover {
    text-decoration: underline;
}

/* Badge-unlock celebration confetti — spawned by showBadgeModal(); pure CSS
   motion (house rule: no JS animation libs), reduced-motion turns it off. */
#badgeUnlockModal .modal-content { overflow: hidden; }
.badge-confetti {
    position: absolute;
    top: -12px;
    height: 10px;
    border-radius: 2px;
    opacity: 0;
    pointer-events: none;
    animation: badge-confetti-fall 1.6s ease-in forwards;
}
@keyframes badge-confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(360px) rotate(540deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .badge-confetti { display: none; }
}
