/* AccessVector Portal Styles */

/* Base styles */
html {
    background-color: #000000; /* Ensure root background is black for overscroll */
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: linear-gradient(to bottom, black, rgb(24, 24, 27), black);
    background-color: #000000; /* Black background fallback */
    color: #fff;
    font-family: 'Inter', sans-serif;
    
    /* Allow rubber band but with black background */
    -webkit-overflow-scrolling: touch;
}

/* Custom properties */
:root {
    --primary-red: rgb(239, 68, 68);
    --primary-cyan: rgb(6, 182, 212);
    --border-red: rgba(239, 68, 68, 0.2);
    --glow-red: rgba(239, 68, 68, 0.3);
    --glow-cyan: rgba(6, 182, 212, 0.3);
}

/* Account Type Badges (used as `<span class="type-badge acct-X">`) */
.type-badge,
.tier-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.acct-standard {
    background: rgba(59, 130, 246, 0.2);
    color: rgb(96, 165, 250);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.acct-msp {
    background: rgba(34, 197, 94, 0.2);
    color: rgb(74, 222, 128);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.acct-admin {
    background: rgba(239, 68, 68, 0.2);
    color: rgb(248, 113, 113);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.acct-beta {
    background: rgba(147, 51, 234, 0.2);
    color: rgb(192, 132, 252);
    border: 1px solid rgba(147, 51, 234, 0.3);
}

/* stat-icon coloring used by dashboard tiles, mirrors the badge palette */
.stat-icon.acct-standard { background: rgba(59, 130, 246, 0.12); color: rgb(96, 165, 250); }
.stat-icon.acct-msp      { background: rgba(34, 197, 94, 0.12);  color: rgb(74, 222, 128); }
.stat-icon.acct-admin    { background: rgba(239, 68, 68, 0.12);  color: rgb(248, 113, 113); }

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: rgb(245, 158, 11);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-active {
    background: rgba(34, 197, 94, 0.2);
    color: rgb(34, 197, 94);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-suspended {
    background: rgba(239, 68, 68, 0.2);
    color: rgb(239, 68, 68);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Portal Navigation */
.portal-nav {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-red);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-links-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.nav-indicator {
    position: absolute;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-red), var(--primary-cyan));
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    border-radius: 3px;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.nav-link {
    color: rgb(209, 213, 219);
    padding: 0.75rem 1.25rem;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.nav-link:hover {
    color: rgba(239, 68, 68, 0.9);
    text-shadow: 0 0 25px rgba(239, 68, 68, 0.6),
                 0 0 50px rgba(239, 68, 68, 0.3);
}

.nav-link.active {
    color: var(--primary-red);
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-red), transparent);
    transform: translateX(-50%);
    transition: width 0.3s ease;
    opacity: 0;
}

.nav-link:hover::after {
    width: 80%;
    opacity: 0.6;
}

/* Content wrapper */
.content-wrapper {
    min-height: calc(100vh - 64px);
    padding-top: 2rem;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(to right, var(--primary-red), var(--primary-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Stat Cards */
.stat-card {
    background: rgba(17, 17, 17, 0.8);
    border: 1px solid var(--border-red);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
}

/* Tier-specific stat-icon variants removed with the account_type refactor.
   Per-account-type variants live with the badge styles above. */

@keyframes pink-glow-pulse {
    from {
        box-shadow: 0 0 15px rgba(255, 20, 147, 0.4), inset 0 0 10px rgba(255, 20, 147, 0.1);
    }
    to {
        box-shadow: 0 0 25px rgba(255, 20, 147, 0.6), inset 0 0 15px rgba(255, 20, 147, 0.2);
    }
}

.stat-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--primary-red);
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 0.875rem;
    color: rgb(156, 163, 175);
}

.stat-sublabel {
    font-size: 0.75rem;
    color: rgb(107, 114, 128);
}

/* Action Cards */
.action-card {
    background: rgba(17, 17, 17, 0.8);
    border: 1px solid var(--border-red);
    border-radius: 0.75rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.action-card:hover {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

/* Section Cards */
.section-card {
    background: rgba(17, 17, 17, 0.8);
    border: 1px solid var(--border-red);
    border-radius: 0.75rem;
    padding: 2rem;
}

/* Buttons */
.primary-button {
    background: linear-gradient(to right, var(--primary-red), rgba(239, 68, 68, 0.8));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--glow-red);
}

.secondary-button {
    background: transparent;
    border: 1px solid var(--border-red);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.secondary-button:hover {
    border-color: var(--primary-red);
    box-shadow: 0 0 20px var(--glow-red);
}

.donate-button {
    background: linear-gradient(to right, var(--primary-cyan), rgba(6, 182, 212, 0.8));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.donate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--glow-cyan);
}

/* Assessment Table */
.assessment-table {
    width: 100%;
    border-collapse: collapse;
}

.assessment-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
    color: rgb(156, 163, 175);
    font-weight: 500;
}

.assessment-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(239, 68, 68, 0.1);
}

.assessment-table tr:hover {
    background: rgba(239, 68, 68, 0.05);
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status-queued {
    background: rgba(156, 163, 175, 0.2);
    color: rgb(156, 163, 175);
}

.status-running {
    background: rgba(234, 179, 8, 0.2);
    color: rgb(234, 179, 8);
}

.status-completed {
    background: rgba(34, 197, 94, 0.2);
    color: rgb(34, 197, 94);
}

.status-failed {
    background: rgba(239, 68, 68, 0.2);
    color: rgb(239, 68, 68);
}

/* Type Badges */
.type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    min-width: 100px;
    text-align: center;
}

/* Scan-type badges. Keep the legacy class names below as aliases so any
   stale rows or cached HTML still render with the right colour. */
.type-deterministic {
    background: rgba(156, 163, 175, 0.2);
    color: rgb(156, 163, 175);
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.type-ai_enabled {
    background: linear-gradient(to right, rgba(239, 68, 68, 0.2), rgba(6, 182, 212, 0.2));
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.type-attack_surface {
    background: rgba(88, 166, 255, 0.18);
    color: rgb(121, 192, 255);
    border: 1px solid rgba(88, 166, 255, 0.35);
}

/* Legacy aliases for the old free/standard/premium scan_type names. Most
   rows have been migrated; these keep any cached pages rendering correctly. */
.type-free,
.type-standard {
    background: rgba(156, 163, 175, 0.2);
    color: rgb(156, 163, 175);
    border: 1px solid rgba(156, 163, 175, 0.3);
}
.type-premium {
    background: linear-gradient(to right, rgba(239, 68, 68, 0.2), rgba(6, 182, 212, 0.2));
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Legacy support for existing scans */
.type-basic {
    background: rgba(156, 163, 175, 0.2);
    color: rgb(156, 163, 175);
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.type-beta_tester {
    background: rgba(147, 51, 234, 0.2);
    color: rgb(147, 51, 234);
    border: 1px solid rgba(147, 51, 234, 0.3);
}

.type-unlimited {
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.2), rgba(255, 20, 147, 0.2), rgba(138, 43, 226, 0.3));
    color: #FFD700;
    border: 2px solid rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4), inset 0 0 10px rgba(255, 215, 0, 0.1);
    animation: glow-pulse 2s ease-in-out infinite alternate;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}

@keyframes glow-pulse {
    from {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4), inset 0 0 10px rgba(255, 215, 0, 0.1);
    }
    to {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.6), inset 0 0 15px rgba(255, 215, 0, 0.2);
    }
}

/* Sparkle animations for unlimited tier */
.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #FFD700;
    border-radius: 50%;
    animation: sparkle-twinkle 3s ease-in-out infinite;
}

.sparkle-1 {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.sparkle-2 {
    top: 70%;
    right: 20%;
    animation-delay: 1s;
}

.sparkle-3 {
    top: 40%;
    left: 80%;
    animation-delay: 2s;
}

.sparkle-4 {
    top: 60%;
    left: 25%;
    animation-delay: 0.5s;
}

.sparkle-5 {
    top: 30%;
    right: 30%;
    animation-delay: 1.5s;
}

.sparkle-6 {
    top: 80%;
    left: 60%;
    animation-delay: 2.5s;
}

.sparkle-7 {
    top: 15%;
    left: 50%;
    animation-delay: 0.8s;
}

.sparkle-8 {
    top: 85%;
    right: 10%;
    animation-delay: 2.2s;
}

@keyframes sparkle-twinkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 10px #FFD700;
    }
}

.glow-text {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

/* Celebration Modal Animations */
.celebration-modal-entrance {
    animation: modal-entrance 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-entrance {
    0% {
        transform: scale(0.7) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.celebration-exit {
    animation: modal-exit 0.5s ease-in-out forwards;
}

@keyframes modal-exit {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.8) rotate(3deg);
        opacity: 0;
    }
}

.celebration-sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: linear-gradient(45deg, #EF4444, #F97316, #FDE047);
    border-radius: 50%;
    animation: sparkle-dance 3s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.8);
}

.celebration-sparkle-1 { top: 10%; left: 10%; animation-delay: 0s; }
.celebration-sparkle-2 { top: 20%; right: 15%; animation-delay: 0.3s; }
.celebration-sparkle-3 { top: 30%; left: 80%; animation-delay: 0.6s; }
.celebration-sparkle-4 { top: 40%; left: 20%; animation-delay: 0.9s; }
.celebration-sparkle-5 { top: 50%; right: 25%; animation-delay: 1.2s; }
.celebration-sparkle-6 { top: 60%; left: 70%; animation-delay: 1.5s; }
.celebration-sparkle-7 { top: 70%; left: 30%; animation-delay: 0.2s; }
.celebration-sparkle-8 { top: 80%; right: 20%; animation-delay: 0.7s; }
.celebration-sparkle-9 { top: 15%; left: 60%; animation-delay: 1.1s; }
.celebration-sparkle-10 { top: 85%; left: 50%; animation-delay: 0.4s; }

@keyframes sparkle-dance {
    0%, 100% {
        transform: translateX(0) translateY(0) scale(0.5);
        opacity: 0.3;
    }
    25% {
        transform: translateX(10px) translateY(-15px) scale(1.2);
        opacity: 1;
    }
    50% {
        transform: translateX(-5px) translateY(-25px) scale(0.8);
        opacity: 0.7;
    }
    75% {
        transform: translateX(-10px) translateY(-10px) scale(1);
        opacity: 0.9;
    }
}

.celebration-icon-bounce {
    animation: icon-bounce 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes icon-bounce {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.celebration-success-pulse {
    animation: success-pulse 2s ease-in-out infinite;
}

@keyframes success-pulse {
    0%, 100% {
        box-shadow: 0 0 25px rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(239, 68, 68, 0.8), 0 0 60px rgba(249, 115, 22, 0.4);
    }
}

.celebration-title-slide {
    animation: title-slide 1s ease-out 0.5s both;
}

@keyframes title-slide {
    0% {
        transform: translateY(-30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.celebration-text-fade-in {
    animation: text-fade-in 1s ease-out 1s both;
}

.celebration-text-fade-in-delay {
    animation: text-fade-in 1s ease-out 1.5s both;
}

@keyframes text-fade-in {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.celebration-button-slide {
    animation: button-slide 1s ease-out 2s both;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.celebration-button-slide:hover {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.7);
}

@keyframes button-slide {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.type-admin {
    background: linear-gradient(to right, rgba(239, 68, 68, 0.2), rgba(234, 179, 8, 0.2));
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Feature Preview */
.feature-preview {
    padding: 1rem;
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.feature-preview:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.4);
}

/* Modal */
.modal {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgb(17, 17, 17);
    border: 1px solid var(--border-red);
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    position: relative;
}

/* Donation Modal Styles */
.preset-amount-btn {
    flex: 1;
    padding: 12px 16px;
    background: rgba(55, 65, 81, 0.8);
    color: white;
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.preset-amount-btn:hover {
    background: rgba(6, 182, 212, 0.8);
    border-color: rgb(6, 182, 212);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.2);
}

.preset-amount-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Selected state for preset buttons */
.preset-amount-btn.selected {
    background: linear-gradient(135deg, rgb(6, 182, 212), rgb(8, 145, 178));
    border-color: rgb(6, 182, 212);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

#card-element {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.5rem;
}

/* Ensure donation modal is visible and properly styled */
#donationModal {
    z-index: 9999 !important;
}

#donationModal .bg-gray-800 {
    background-color: rgb(31, 41, 55) !important;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

#donationModal .auth-input {
    background: rgba(31, 41, 55, 0.8);
    border: 2px solid rgba(75, 85, 99, 0.5);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#donationModal .auth-input:focus {
    outline: none;
    border-color: rgb(6, 182, 212);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
    background: rgba(31, 41, 55, 0.9);
}

#donationModal .auth-input::placeholder {
    color: rgba(156, 163, 175, 0.8);
    font-weight: 400;
}

/* Hide number input spinners */
#donationModal .auth-input::-webkit-outer-spin-button,
#donationModal .auth-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#donationModal .auth-input[type=number] {
    -moz-appearance: textfield;
}

#donationModal .auth-button {
    background: linear-gradient(to right, var(--primary-red), rgba(239, 68, 68, 0.8));
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    color: rgb(156, 163, 175);
    cursor: pointer;
}

.close:hover {
    color: var(--primary-red);
}

/* Donation Tiers */
.donation-tiers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.donation-tier {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid var(--border-red);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.donation-tier:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--primary-red);
    transform: translateY(-2px);
}

.donation-tier.selected {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--primary-red);
    box-shadow: 0 0 20px var(--glow-red);
}

.tier-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-red);
}

.tier-benefit {
    font-size: 0.875rem;
    color: rgb(156, 163, 175);
    margin-top: 0.25rem;
}

/* Custom Amount Input */
.custom-amount-input {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-red);
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
}

.custom-amount-input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 10px var(--glow-red);
}

.donate-button-large {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(to right, var(--primary-cyan), rgba(6, 182, 212, 0.8));
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.donate-button-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--glow-cyan);
}

/* Action Link */
.action-link {
    color: var(--primary-cyan);
    text-decoration: none;
    transition: all 0.3s ease;
}

.action-link:hover {
    color: white;
    text-shadow: 0 0 10px var(--glow-cyan);
}

/* New Assessment Form */
.assessment-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: rgb(156, 163, 175);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-red);
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 10px var(--glow-red);
}

/* Defeat Chrome's autofill background/text colors. Chrome rewrites
   `background-color` on autofilled fields to a pale yellow/white to
   mark them as "auto-filled"; setting our own `background-color` gets
   ignored. The inset box-shadow trick paints over it with our dark
   palette, and `-webkit-text-fill-color` restores white text. The
   long transition delay is a belt-and-suspenders fallback — Chrome
   animates the autofill color in, so a 5000s transition keeps our
   background alive indefinitely if the box-shadow gets overridden in
   some future build. */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
    -webkit-box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.5) !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff;
    transition: background-color 5000s ease-in-out 0s,
                color            5000s ease-in-out 0s;
}

/* Fix dropdown arrow spacing for select elements */
select.form-input {
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23f87171' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.6rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem 1.25rem;
    appearance: none;
    cursor: pointer;
}

/* Option list theming. Most browsers render the OPEN <option> list at
   the OS level — Chrome/Firefox/Safari honor background+color, others
   fall back to system defaults. The :disabled rule paints locked
   options red (used today only for pipeline options blocked because
   the chosen target is under review); inline yellow on review targets
   in the target picker takes precedence via the cascade. */
.form-input option {
    background: #0d1117;
    color: #c9d1d9;
    padding: 6px 8px;
}

.form-input option:disabled {
    background: rgba(248, 113, 113, 0.10);
    color: #f87171;
    font-style: italic;
}

.form-input option[value="__add_target__"],
.form-input option[value="__add__"] {
    color: #58a6ff;
    font-style: italic;
}


/* Dark theme for date picker */
input[type="date"] {
    color-scheme: dark;
}

/* Webkit date picker dark theme */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Firefox date picker dark theme */
@-moz-document url-prefix() {
    input[type="date"] {
        background-color: rgba(0, 0, 0, 0.5);
        color: white;
        border: 1px solid var(--border-red);
    }
}

.form-hint {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: rgb(107, 114, 128);
}

/* Scan Type Selection */
.scan-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.scan-type-option {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--border-red);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scan-type-option:hover {
    border-color: var(--primary-red);
    background: rgba(239, 68, 68, 0.05);
}

.scan-type-option.selected {
    border-color: var(--primary-red);
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 20px var(--glow-red);
}

.scan-type-title {
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
}

.scan-type-description {
    font-size: 0.875rem;
    color: rgb(156, 163, 175);
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(239, 68, 68, 0.2);
    border-top: 3px solid var(--primary-red);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(239, 68, 68, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary-red), var(--primary-cyan));
    border-radius: 4px;
    transition: width 0.5s ease;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Auto-refresh indicator */
.animate-spin {
    animation: spin 1s linear infinite;
}

/* Real-time stats indicators */
.stat-card.realtime {
    position: relative;
}

.stat-card.realtime::after {
    content: '●';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: var(--primary-cyan);
    font-size: 0.5rem;
    animation: pulse 2s infinite;
}

/* Sortable table headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: all 0.2s ease;
    padding-right: 30px; /* Space for arrow */
}

.sortable:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--primary-red);
}

.sortable .sort-icon {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
    transition: all 0.3s ease;
    color: rgb(209, 213, 219);
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.sortable:hover .sort-icon {
    opacity: 1;
    color: var(--primary-red);
}

/* Active sort states */
.sortable.sort-asc,
.sortable.sort-desc {
    background: rgba(239, 68, 68, 0.2);
    color: var(--primary-red);
    font-weight: 700;
    border-left: 3px solid var(--primary-red);
    position: relative;
    padding-left: 8px; /* Offset for border */
    margin-right: 2px; /* Prevent bleeding into next column */
}

.sortable.sort-asc .sort-icon,
.sortable.sort-desc .sort-icon {
    opacity: 1;
    color: rgb(34, 197, 94);
}

/* Active user indicator */
.active-indicator {
    width: 12px;
    height: 12px;
    background: rgb(34, 197, 94);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(34, 197, 94, 0.4);
    }
    to {
        box-shadow: 0 0 15px rgba(34, 197, 94, 0.8);
    }
}

/* Recent user indicator (5-15 minutes) */
.recent-indicator {
    width: 12px;
    height: 12px;
    background: rgb(245, 158, 11);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
    animation: yellowGlow 2s ease-in-out infinite alternate;
}

@keyframes yellowGlow {
    from {
        box-shadow: 0 0 4px rgba(245, 158, 11, 0.3);
    }
    to {
        box-shadow: 0 0 12px rgba(245, 158, 11, 0.7);
    }
}

/* Inactive user indicator */
.inactive-indicator {
    width: 12px;
    height: 12px;
    background: rgb(107, 114, 128);
    border-radius: 50%;
}

/* Consistent badge width (account-type and tier-* aliases share this) */
.tier-badge,
.type-badge {
    min-width: 100px;
    text-align: center;
    display: inline-block;
}

/* ============================================================
   Themed Select (custom dropdown widget — see assets/js/themed-select.js)
   ============================================================
   The native <select> stays in the DOM (clipped) so form submission and
   accessibility tools still work; the wrapper paints the closed trigger
   and the open popup list to match the dark/red theme.
*/
.ts-wrap {
    position: relative;
    width: 100%;
}

/* Native <select> still posts the value but is visually replaced by the
   trigger button. Clipping (instead of display:none) keeps form
   validation, focus traversal, and the option list reachable via
   programmatic value changes. */
.ts-native.form-input,
.ts-wrap select.ts-native {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: 0;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
    pointer-events: none;
    opacity: 0;
}

.ts-trigger {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
    padding: 0.75rem 2rem 0.75rem 0.85rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-red);
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.25;
    transition: border-color .12s, box-shadow .12s, background .12s;
}
.ts-trigger:hover:not(:disabled) {
    /* Cyan hover hint — the interactive-feedback color, distinct from
       the red brand border the trigger sits at by default. */
    background: rgba(6, 182, 212, 0.06);
    border-color: rgba(6, 182, 212, 0.55);
}
.ts-trigger:disabled {
    opacity: 0.6; cursor: not-allowed;
}
.ts-wrap.ts-open .ts-trigger,
.ts-trigger:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 10px var(--glow-red);
}

.ts-trigger-label {
    display: inline-block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ts-trigger.ts-placeholder .ts-trigger-label { color: #7d8590; font-style: italic; }

.ts-trigger-arrow {
    flex: 0 0 auto;
    margin-left: 0.5rem;
    width: 1rem; height: 1rem;
    border-right: 2px solid #f87171;
    border-bottom: 2px solid #f87171;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .15s ease;
    display: inline-block;
}
.ts-wrap.ts-open .ts-trigger-arrow {
    transform: rotate(-135deg) translate(-2px, -2px);
}

/* ----- Open option panel ----- */
.ts-list {
    list-style: none;
    margin: 4px 0 0;
    padding: 4px;
    position: absolute;
    top: 100%; left: 0; right: 0;
    z-index: 50;
    max-height: 280px;
    overflow-y: auto;
    background: #0d1117;
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-radius: 0.5rem;
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(248, 113, 113, 0.10);
    animation: ts-pop .12s ease-out;
}
@keyframes ts-pop {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ts-list::-webkit-scrollbar          { width: 8px; }
.ts-list::-webkit-scrollbar-thumb    { background: rgba(248,113,113,.35); border-radius: 4px; }
.ts-list::-webkit-scrollbar-track    { background: transparent; }

.ts-option {
    padding: 8px 10px;
    border-radius: 0.35rem;
    color: #c9d1d9;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.25;
    user-select: none;
    transition: background .08s;
}
.ts-option + .ts-option { margin-top: 2px; }

/* Hover + keyboard-active highlight use cyan — interactive feedback. */
.ts-option:hover,
.ts-option.ts-active {
    background: rgba(6, 182, 212, 0.14);
    color: #67e8f9;
}

/* Selected stays in the red brand palette — it's "this is the chosen
   one," distinct from "you're hovering this one." Hover-over-selected
   still gets the cyan wash so the user sees the hover signal even on
   the currently-selected row. */
.ts-option.ts-selected {
    background: rgba(248, 113, 113, 0.18);
    color: #fff;
    font-weight: 500;
}
.ts-option.ts-selected.ts-active,
.ts-option.ts-selected:hover {
    background: rgba(6, 182, 212, 0.22);
    color: #67e8f9;
}

.ts-option.ts-disabled {
    color: #f87171;
    background: rgba(248, 113, 113, 0.06) !important;
    font-style: italic;
    cursor: not-allowed;
    opacity: 0.85;
}

/* Attention flash on the themed-select trigger — fires when JS forced
   an auto-swap (e.g. the pipeline picker was bumped to INIT because the
   chosen target is under scope review). Yellow because the baseline
   border is already red; yellow pops against it and matches the
   under-review color the user just picked. Single quick pulse, then
   the flip-text animation takes over for the actual swap. */
.ts-wrap.ts-flash-attention .ts-trigger {
    animation: ts-flash 0.45s ease-out 1;
}
@keyframes ts-flash {
    0%   { border-color: var(--border-red);         box-shadow: 0 0 0 0 rgba(250,204,21,0); }
    40%  { border-color: rgba(250,204,21,1);        box-shadow: 0 0 18px rgba(250,204,21,0.7); }
    100% { border-color: var(--border-red);         box-shadow: 0 0 0 0 rgba(250,204,21,0); }
}

/* Split-flap / mechanical clock text flip on the trigger label. Two
   absolutely-positioned ghosts overlap the real label during the
   swap: old text rotates down out of view (hinged at center),
   new text rotates in from above. Real label is visibility:hidden
   during animation so its instant textContent update doesn't flicker
   through. */
.ts-flip-overlay {
    position: absolute;
    top: 0; bottom: 0;
    left: 0.85rem; right: 2rem;
    perspective: 600px;
    pointer-events: none;
    overflow: hidden;
    display: flex; align-items: center;
}
.ts-flip-old, .ts-flip-new {
    position: absolute;
    left: 0; right: 0; top: 50%;
    transform-origin: center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    will-change: transform, opacity;
    /* Use the same color/style as the real label by default; if the
       caller wants a special palette it can be applied inline. */
    color: white;
}
.ts-flip-old {
    animation: ts-flap-out 0.32s cubic-bezier(.45,.05,.55,.95) forwards;
    transform: translateY(-50%) rotateX(0deg);
}
.ts-flip-new {
    animation: ts-flap-in 0.32s cubic-bezier(.45,.05,.55,.95) 0.30s forwards;
    transform: translateY(-50%) rotateX(90deg);
    opacity: 0;
}
@keyframes ts-flap-out {
    0%   { transform: translateY(-50%) rotateX(0deg);   opacity: 1; }
    100% { transform: translateY(-50%) rotateX(-90deg); opacity: 0; }
}
@keyframes ts-flap-in {
    0%   { transform: translateY(-50%) rotateX(90deg);  opacity: 0; }
    50%  { opacity: 1; }
    100% { transform: translateY(-50%) rotateX(0deg);   opacity: 1; }
}

/* Floating tooltip appended to <body> by themed-select.js — escapes the
   dropdown's overflow so it can render anywhere on the viewport. JS
   positions it near the cursor; CSS handles look + fade-in. */
.ts-tip {
    position: fixed;
    z-index: 10000;
    max-width: 280px;
    padding: 8px 12px;
    background: #161b22;
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-radius: 6px;
    color: #fca5a5;
    font-size: 0.78rem;
    font-style: normal;
    line-height: 1.4;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity .1s ease-out, transform .1s ease-out;
}
.ts-tip.ts-tip-show {
    opacity: 1;
    transform: translateY(0);
}




/* ============================================================
   Address Autocomplete (Nominatim) — see assets/js/address-autocomplete.js
   ============================================================
   Themed dropdown matching the rest of the form palette. Pinned below
   the street input; suggestions show primary line + secondary line
   (city / state postal / country).
*/
.ac-wrap   { position: relative; width: 100%; }
.ac-panel {
    /* Anchored ABOVE the input — Chrome's saved-address autofill
       pops up below an address-like input no matter what we set on
       the field, so positioning our own suggestions on the opposite
       side keeps them out of each other's way. */
    position: absolute;
    bottom: calc(100% + 4px); left: 0; right: 0;
    z-index: 60;
    max-height: 280px;
    overflow-y: auto;
    background: #0d1117;
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-radius: 0.5rem;
    box-shadow:
        0 -12px 24px rgba(0,0,0,0.55),
        0 0 0 1px rgba(248,113,113,0.10);
    padding: 4px;
    animation: ac-pop-up .12s ease-out;
}
@keyframes ac-pop-up {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ac-panel::-webkit-scrollbar       { width: 8px; }
.ac-panel::-webkit-scrollbar-thumb { background: rgba(248,113,113,.35); border-radius: 4px; }
.ac-panel::-webkit-scrollbar-track { background: transparent; }

.ac-row {
    padding: 8px 10px;
    border-radius: 0.35rem;
    cursor: pointer;
    color: #c9d1d9;
    transition: background .08s;
}
.ac-row + .ac-row { margin-top: 2px; }
.ac-row:hover, .ac-row.ac-active {
    background: rgba(6, 182, 212, 0.14);
    color: #67e8f9;
}
.ac-row-primary   { font-size: 0.92rem; font-weight: 500; }
.ac-row-secondary { font-size: 0.78rem; color: #94a3b8; margin-top: 2px; }
.ac-row:hover .ac-row-secondary,
.ac-row.ac-active .ac-row-secondary { color: rgba(103, 232, 249, 0.85); }

.ac-empty {
    padding: 10px;
    color: #7d8590;
    font-style: italic;
    text-align: center;
    font-size: 0.85rem;
}

/* ============================================================
   Profile Edit Modal (account.php) — replaces the cramped 4xl
   version. Wider panel, sticky header + footer, sectioned body
   with subtle card backgrounds. Hidden state still uses the
   Tailwind `.hidden` class for compatibility with existing JS.
*/
.profile-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.profile-modal.hidden { display: none; }

.profile-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.profile-modal-panel {
    position: relative;
    width: 100%;
    max-width: 64rem;       /* 1024px — meaningfully wider than the old 4xl */
    max-height: 90vh;
    background: linear-gradient(180deg, #14171c 0%, #0d1117 100%);
    border: 1px solid rgba(248, 113, 113, 0.22);
    border-radius: 0.85rem;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.02);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.profile-modal-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;          /* important so the body can shrink + scroll */
}

.profile-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.25);
    position: sticky; top: 0; z-index: 2;
}

.profile-modal-close {
    color: #94a3b8;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 0.4rem;
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: color .12s, border-color .12s, background .12s;
}
.profile-modal-close:hover {
    color: #fff;
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(248, 113, 113, 0.08);
}
.profile-modal-close svg { width: 16px; height: 16px; }

.profile-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.profile-modal-body::-webkit-scrollbar       { width: 10px; }
.profile-modal-body::-webkit-scrollbar-thumb { background: rgba(248, 113, 113, 0.30); border-radius: 5px; }
.profile-modal-body::-webkit-scrollbar-track { background: transparent; }

.profile-modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.25);
    position: sticky; bottom: 0; z-index: 2;
}

/* ---- Sections ---- */
.pf-section {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.65rem;
    padding: 1rem 1.15rem 1.15rem;
}
.pf-section--accent {
    background: linear-gradient(180deg, rgba(6,182,212,0.05), rgba(0,0,0,0));
    border-color: rgba(6, 182, 212, 0.18);
}
.pf-section-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #d1d5db;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.pf-section-head svg,
.pf-section-head i {
    width: 14px; height: 14px;
    color: rgba(248, 113, 113, 0.9);
}
.pf-section--accent .pf-section-head svg,
.pf-section--accent .pf-section-head i {
    color: rgba(6, 182, 212, 0.95);
}
.pf-section-aside {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 400;
    color: #6b7280;
    text-transform: none;
    letter-spacing: 0;
}
.pf-section-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* ---- Read-only input dimming ---- */
.form-input.pf-readonly {
    color: #9ca3af;
    background: rgba(0, 0, 0, 0.25);
    cursor: not-allowed;
}

/* ---- Logo uploader (cleaner than the old dashed box) ---- */
.pf-logo-row {
    display: flex;
    gap: 0.95rem;
    align-items: center;
}
.pf-logo-tile {
    flex: 0 0 auto;
    width: 84px; height: 84px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.25);
    border-radius: 0.6rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    overflow: hidden;
}
.pf-logo-tile:hover {
    border-color: rgba(248, 113, 113, 0.55);
    background: rgba(248, 113, 113, 0.05);
}
.pf-logo-preview { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.pf-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pf-logo-preview svg,
.pf-logo-preview i { width: 28px; height: 28px; color: #6b7280; }
.pf-logo-meta { flex: 1 1 auto; min-width: 0; }
.pf-logo-title { font-size: 0.92rem; font-weight: 500; color: #e6edf3; margin-bottom: 0.2rem; }

/* form-group default spacing inside the new modal — keep it
   tight since pf-section-body already manages vertical rhythm. */
.profile-modal-body .form-group { margin: 0; }
.profile-modal-body .form-label { margin-bottom: 0.35rem; font-size: 0.78rem; color: #9ca3af; }
.profile-modal-body .form-input { font-size: 0.95rem; padding: 0.6rem 0.8rem; }
.profile-modal-body .form-input[type="date"] { padding: 0.55rem 0.8rem; }
.profile-modal-body .form-hint  { font-size: 0.72rem; color: #6b7280; margin-top: 0.25rem; }

/* The Tailwind `.hidden` rule already collapses #profileModal, but
   leave a no-op below so future authors don't accidentally use
   `[hidden]` on the modal and break the layout. */
.profile-modal[hidden] { display: none; }

@media (max-width: 720px) {
    .profile-modal { padding: 0.5rem; }
    .profile-modal-panel { max-height: 95vh; border-radius: 0.55rem; }
    .profile-modal-head, .profile-modal-foot { padding-left: 1rem; padding-right: 1rem; }
    .profile-modal-body { padding: 1rem; }
    .pf-section { padding: 0.85rem 0.95rem 1rem; }
}

/* ============================================================
   API Access modal (account.php)
*/
.api-key-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(6, 182, 212, 0.30);
    border-radius: 0.5rem;
    overflow: hidden;
}
.api-key-value {
    flex: 1; min-width: 0;
    padding: 0.85rem 1rem;
    color: #67e8f9;
    font-family: 'DejaVu Sans Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
    word-break: break-all;
    line-height: 1.4;
    user-select: all;
}
.api-key-copy {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0 0.95rem;
    background: rgba(6, 182, 212, 0.10);
    color: #67e8f9;
    border: 0;
    border-left: 1px solid rgba(6, 182, 212, 0.30);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: background .12s, color .12s;
}
.api-key-copy:hover {
    background: rgba(6, 182, 212, 0.22);
    color: #fff;
}
.api-key-copy.api-key-copy-ok {
    background: rgba(34, 197, 94, 0.20);
    color: #86efac;
    border-left-color: rgba(34, 197, 94, 0.45);
}
.api-key-copy svg, .api-key-copy i { width: 14px; height: 14px; }

.api-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.6rem 0.8rem;
    background: rgba(250, 204, 21, 0.08);
    border: 1px solid rgba(250, 204, 21, 0.25);
    border-radius: 0.4rem;
    font-size: 0.78rem;
    color: #fde68a;
    line-height: 1.45;
}
.api-warning svg,
.api-warning i {
    flex-shrink: 0;
    color: #facc15;
    margin-top: 1px;
}

/* ============================================================
   Shared modal system (mu-modal) — originally in manage-users.php,
   now used by customer-profile.php (Add Agent modal) too. Kept
   class-prefixed so it doesn't collide with anything else.
   ============================================================ */
.mu-modal:not(.hidden) {
    position: fixed; inset: 0; z-index: 50;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.mu-modal.hidden { display: none; }
.mu-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}
.mu-modal-panel {
    background: linear-gradient(180deg, #14171c 0%, #0d1117 100%);
    border: 1px solid rgba(248, 113, 113, 0.22);
    border-radius: 0.85rem;
    width: 100%; max-width: 32rem;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
}
.mu-modal-head, .mu-modal-foot {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mu-modal-foot {
    border-bottom: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    gap: 0.6rem; justify-content: flex-end;
}
.mu-modal-body {
    padding: 1.25rem;
    display: flex; flex-direction: column; gap: 0.95rem;
}
.mu-modal-close {
    background: transparent; border: 0; color: #94a3b8;
    cursor: pointer; padding: 0.15rem 0.4rem;
}
.mu-modal-close:hover { color: #fff; }

.mu-pwd-reveal {
    display: flex; align-items: stretch;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(250, 204, 21, 0.35);
    border-radius: 0.5rem;
    overflow: hidden;
}
.mu-pwd-reveal code {
    flex: 1; min-width: 0;
    padding: 0.75rem 0.9rem;
    color: #facc15;
    font-family: 'DejaVu Sans Mono', ui-monospace, SFMono-Regular, monospace;
    font-size: 0.92rem; letter-spacing: 0.03em;
    word-break: break-all; user-select: all;
}
.mu-pwd-copy {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0 0.95rem;
    background: rgba(250, 204, 21, 0.10);
    color: #facc15;
    border: 0; border-left: 1px solid rgba(250, 204, 21, 0.35);
    cursor: pointer;
    font-size: 0.85rem; font-weight: 500;
}
.mu-pwd-copy:hover { background: rgba(250, 204, 21, 0.22); color: #fff; }
.mu-pwd-copy.mu-pwd-copy-ok {
    background: rgba(34, 197, 94, 0.22);
    color: #86efac;
    border-left-color: rgba(34, 197, 94, 0.45);
}
.mu-pwd-copy svg, .mu-pwd-copy i { width: 14px; height: 14px; }
