/* =============================================
   MEETIME — DESIGN SYSTEM v2 "Midnight Romance"
   Rose × Violet — Dark Neon Dating Aesthetic
   ============================================= */

/* ─── NEW BRAND TOKENS ─── */
:root {
    --primary: #FF2D78;
    --primary-dark: #D91565;
    --primary-glow: rgba(255, 45, 120, 0.4);

    --secondary: #7B2DFF;
    --secondary-dark: #6520E0;
    --secondary-glow: rgba(123, 45, 255, 0.3);

    --accent: #FF6B35;

    --dark: #070711;
    --card: #0F0F1E;
    --card-hover: #16162A;
    --card-2: #1A1A2E;
    --surface: #13131F;

    --border: rgba(255,255,255,0.08);
    --border-light: rgba(255,255,255,0.12);

    --gray: #5A5A7A;
    --muted: #5A5A7A;
    --light-gray: #9898C0;
    --text: #F0F0FF;

    --gradient: linear-gradient(135deg, #FF2D78 0%, #7B2DFF 100%);
    --gradient-warm: linear-gradient(135deg, #FF2D78 0%, #FF6B35 100%);
    --gradient-cool: linear-gradient(135deg, #7B2DFF 0%, #FF2D78 100%);
    --gradient-dark: linear-gradient(135deg, #D91565 0%, #6520E0 100%);
    --gradient-animated: linear-gradient(270deg, #FF2D78, #7B2DFF, #FF2D78);

    --success: #00E5A0;
    --warning: #FFB800;
    --error: #FF3860;

    /* ─── FONT FAMILIES ─── */
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
}

/* ─── GLOBAL TYPOGRAPHY ─── */
body {
    background: var(--dark);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: none;
    overflow-x: hidden;
}

/* Prevent iOS auto-zoom on input focus (requires min 16px) */
input, textarea, select {
    font-size: max(16px, 1em);
}

/* Heading font — all semantic headings + common heading classes */
h1, h2, h3, h4, h5, h6,
.page-title,
.section-title,
.hero-title,
.hero-heading,
.card-title,
.modal-title,
.tab-title,
.chapter-label,
.step-title,
.blocked-title,
.empty-title,
.profile-name,
.match-photo-name,
.event-date,
.my-event-name,
.needs-quiz h3 {
    font-family: var(--font-heading) !important;
    letter-spacing: -0.02em;
}

/* Logo — extra weight for brand presence */
.logo,
.nav-logo,
.brand-logo,
.footer-logo,
.logo-text {
    font-family: var(--font-heading) !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
}

/* ─── BACKGROUND GLOWS ─── */
.bg-glow-1 { background: var(--primary) !important; opacity: 0.12 !important; }
.bg-glow-2 { background: var(--secondary) !important; opacity: 0.1 !important; }

/* ─── LOGO / BRAND ─── */
.nav-logo,
.logo,
.brand-logo,
.footer-logo,
.logo-text {
    background: var(--gradient) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* ─── HEADER GLASS ─── */
.header {
    background: rgba(7, 7, 17, 0.92) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border-bottom: 1px solid rgba(255, 45, 120, 0.12) !important;
}

/* ─── BUTTONS ─── */
.btn-primary,
button.btn-primary,
.nav-btn-primary,
a.nav-btn-primary {
    background: var(--gradient) !important;
    box-shadow: 0 4px 20px rgba(255, 45, 120, 0.35) !important;
    border: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-primary:hover:not(:disabled),
button.btn-primary:hover:not(:disabled),
.nav-btn-primary:hover,
a.nav-btn-primary:hover {
    box-shadow: 0 8px 32px rgba(255, 45, 120, 0.55), 0 0 0 1px rgba(255, 45, 120, 0.3) !important;
    transform: translateY(-2px) !important;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0) !important;
    box-shadow: 0 2px 10px rgba(255, 45, 120, 0.4) !important;
}

/* Nav links that act as buttons */
.nav-link.nav-btn {
    background: var(--gradient) !important;
    box-shadow: 0 4px 15px rgba(255, 45, 120, 0.3) !important;
}

/* ─── CARDS - GLASSMORPHISM ─── */
.form-card {
    background: rgba(15, 15, 30, 0.85) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 45, 120, 0.12) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.profile-hero,
.question-card {
    background: var(--card) !important;
    border: 1px solid rgba(255, 45, 120, 0.12) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

.profile-hero::before {
    background: var(--gradient) !important;
}

/* ─── INPUTS - ENHANCED FOCUS ─── */
.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(255, 45, 120, 0.15), 0 0 20px rgba(255, 45, 120, 0.08) !important;
}

/* ─── PROFILE AVATAR GLOW ─── */
.profile-avatar {
    background: var(--gradient) !important;
    box-shadow: 0 8px 32px rgba(255, 45, 120, 0.4), 0 0 60px rgba(123, 45, 255, 0.2) !important;
}

/* ─── PROFILE AVATAR RING ─── */
.profile-avatar-container::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--gradient);
    z-index: -1;
    opacity: 0.7;
    filter: blur(4px);
}

/* ─── MENU BUTTONS ─── */
.menu-btn {
    background: var(--gradient) !important;
    box-shadow: 0 8px 24px rgba(255, 45, 120, 0.25) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.menu-btn:hover {
    box-shadow: 0 14px 36px rgba(255, 45, 120, 0.45) !important;
    transform: translateY(-4px) !important;
}

/* ─── PROGRESS STEPS ─── */
.progress-step.active {
    background: var(--gradient) !important;
    box-shadow: 0 0 10px rgba(255, 45, 120, 0.4) !important;
}

.progress-step.completed {
    background: var(--success) !important;
}

/* ─── OPTION ITEMS ─── */
.option-item.selected {
    border-color: var(--primary) !important;
    background: rgba(255, 45, 120, 0.06) !important;
    box-shadow: 0 0 0 3px rgba(255, 45, 120, 0.12) !important;
}

.option-item:hover {
    border-color: rgba(255, 45, 120, 0.4) !important;
}

/* ─── RANGE INPUT ─── */
input[type="range"]::-webkit-slider-thumb {
    background: var(--gradient) !important;
    box-shadow: 0 0 10px rgba(255, 45, 120, 0.4) !important;
}
input[type="range"]::-moz-range-thumb {
    background: var(--gradient) !important;
}

/* ─── PHOTO UPLOAD ─── */
.photo-preview:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 0 24px rgba(255, 45, 120, 0.25) !important;
}

.photo-preview.has-photo {
    border-color: var(--success) !important;
    box-shadow: 0 0 20px rgba(0, 229, 160, 0.2) !important;
}

/* ─── SPINNER ─── */
.spinner {
    border-top-color: var(--primary) !important;
}

/* ─── LINKS ─── */
.forgot-link,
a.form-footer a {
    color: var(--primary) !important;
}

/* ─── UNREAD BADGE ─── */
.unread-badge-header {
    background: var(--primary) !important;
    box-shadow: 0 2px 10px rgba(255, 45, 120, 0.5) !important;
}

/* ─── CHAT SEND BUTTON ─── */
#sendBtn,
.send-btn {
    background: var(--gradient) !important;
    box-shadow: 0 4px 15px rgba(255, 45, 120, 0.35) !important;
}

/* ─── CHAT BUBBLES ─── */
.message.sent .bubble,
.message-bubble.sent,
.message-sent .bubble {
    background: var(--gradient) !important;
    box-shadow: 0 4px 12px rgba(255, 45, 120, 0.3) !important;
}

/* ─── SUCCESS/ERROR MESSAGES ─── */
.error-message {
    background: rgba(255, 56, 96, 0.08) !important;
    border-color: rgba(255, 56, 96, 0.25) !important;
    color: var(--error) !important;
}

.success-message {
    background: rgba(0, 229, 160, 0.08) !important;
    border-color: rgba(0, 229, 160, 0.25) !important;
    color: var(--success) !important;
}

/* ─── VERIFICATION BOX ─── */
.verification-box {
    background: rgba(255, 184, 0, 0.08) !important;
    border-color: rgba(255, 184, 0, 0.25) !important;
    color: var(--warning) !important;
}

/* ─── CALENDAR DAYS ─── */
.calendar-day.available:hover,
.calendar-day.selected {
    background: var(--gradient) !important;
    box-shadow: 0 4px 15px rgba(255, 45, 120, 0.3) !important;
}

/* ─── TABLE HIGHLIGHTS ─── */
tr:hover td {
    background: rgba(255, 45, 120, 0.04) !important;
}

/* ─── FEEDBACK STARS ─── */
.star-filled,
.star:hover,
.star.active {
    color: var(--primary) !important;
    text-shadow: 0 0 10px rgba(255, 45, 120, 0.5) !important;
}

/* ─── ANIMATIONS ─── */

@keyframes rose-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 45, 120, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 45, 120, 0.6), 0 0 70px rgba(123, 45, 255, 0.2); }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    from { background-position: -200% center; }
    to { background-position: 200% center; }
}

/* ─── ENTRY ANIMATIONS ─── */
.form-card,
.profile-hero,
.question-card {
    animation: fade-up 0.4s ease-out both;
}

.form-card:nth-child(1) { animation-delay: 0.05s; }
.form-card:nth-child(2) { animation-delay: 0.1s; }

/* ─── BOTTOM NAV ─── */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(7, 7, 17, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border);
    display: none;
    align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 200;
    /* Força GPU compositing layer própria — imune ao bug iOS Safari
       onde filter:blur() em elementos fixed quebra outros position:fixed */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px 8px;
    text-decoration: none;
    color: var(--gray);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    gap: 4px;
    transition: all 0.2s ease;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
}

.nav-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav-item .nav-icon {
    font-size: 21px;
    line-height: 1;
    transition: all 0.2s ease;
}

.bottom-nav-item svg {
    width: 21px;
    height: 21px;
    transition: all 0.2s ease;
    display: block;
}

.nav-badge {
    position: absolute;
    top: -5px;
    right: -9px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: var(--primary, #FF2D78);
    color: white;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
    display: none;
    border: 2px solid rgba(7, 7, 17, 0.96);
    pointer-events: none;
    animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-badge.visible {
    display: block;
}

@keyframes badgePop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active .nav-icon,
.bottom-nav-item.active svg {
    filter: drop-shadow(0 0 6px rgba(255, 45, 120, 0.7));
    transform: scale(1.1);
}

.bottom-nav-item:active .nav-icon,
.bottom-nav-item:active svg {
    transform: scale(0.9);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--gradient);
    border-radius: 0 0 2px 2px;
    box-shadow: 0 0 8px rgba(255, 45, 120, 0.6);
}

/* ─── SAFE AREA — notch / Dynamic Island / home bar ─── */

/* Universal: push entire page below status bar in standalone PWA.
   env(safe-area-inset-top) is 0 in browser, so this is a no-op outside PWA. */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top, 0px);
    }
    /* .header already adds its own safe-area padding; in standalone the body
       already pushed content down, so just use normal spacing */
    .header {
        padding-top: 16px !important;
    }
}

/* iOS Safari fallback: display-mode media query not reliable on some older
   WebKit builds — pwa-init.js adds this class as a safety net */
body.pwa-standalone {
    padding-top: env(safe-area-inset-top, 0px);
}
body.pwa-standalone .header {
    padding-top: 16px !important;
}

/* .header in browser (non-PWA): normal safe-area-aware padding */
.header {
    padding-top: max(16px, env(safe-area-inset-top, 0px)) !important;
}

/* ─── SHOW BOTTOM NAV: mobile OR PWA standalone ─── */
@media (max-width: 768px), (display-mode: standalone) {
    .bottom-nav {
        display: flex !important;
    }

    .has-bottom-nav {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .hide-on-mobile {
        display: none !important;
    }
}

/* iOS PWA fallback via JS body class */
body.pwa-standalone .bottom-nav {
    display: flex !important;
}
body.pwa-standalone .has-bottom-nav {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ─── HERO BADGE ─── */
.hero-badge {
    background: rgba(255, 45, 120, 0.12) !important;
    border-color: rgba(255, 45, 120, 0.25) !important;
}

/* ─── STAT NUMBERS ─── */
.stat-number {
    background: var(--gradient) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* ─── FEATURE ICONS ─── */
.feature-icon {
    background: rgba(255, 45, 120, 0.08) !important;
    border-color: rgba(255, 45, 120, 0.15) !important;
}

/* ─── DINNER/EVENT CARD ─── */
.event-card,
.dinner-card {
    border-color: rgba(255, 45, 120, 0.12) !important;
}

/* ─── THEME COLOR META TAG OVERRIDE (JS) ─── */
