/* ==========================================================================
   ACCESSUG INSTAGRAM ENGINE - STYLESHEET (BENTO UI)
   ========================================================================== */

:root {
    /* Soft, friendly, premium color palette */
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f9fafb;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    --border-light: #e2e8f0;
    --border-strong: #cbd5e1;
    
    /* Instagram Specific Brand Colors */
    --brand-ig-purple: #8b5cf6;
    --brand-ig-purple-bg: #f3e8ff;
    --brand-ig-pink: #d946ef;
    --brand-ig-pink-bg: #fae8ff;
    --brand-ig-gold: #f59e0b;
    --brand-ig-gold-bg: #fef3c7;
    
    --brand-green: #10b981;
    --brand-green-bg: #d1fae5;
    
    /* Layout */
    --app-max-width: 540px;
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-pill: 100px;
    
    /* Animations */
    --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- 1. RESET & DEFAULTS --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg-page); color: var(--text-main); font-family: 'Inter', sans-serif; line-height: 1.5; overflow-x: hidden; }
button, input { font-family: inherit; border: none; outline: none; background: none; }
button { cursor: pointer; }

/* --- 2. INSTAGRAM SUNSET BACKGROUND --- */
.ambient-glow-background { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: #f8fafc; }
.glow-shape { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35; animation: floatBg 25s infinite alternate ease-in-out; }
/* Sunset Gold */
.shape-blue { width: 50vw; height: 50vw; background: #fde68a; top: -10%; left: -10%; }
/* Magenta Pink */
.shape-pink { width: 60vw; height: 60vw; background: #fbcfe8; bottom: -10%; right: -10%; animation-delay: -5s; animation-direction: alternate-reverse; }
/* Deep Purple (Added for IG feel) */
.ambient-glow-background::after { content:''; position: absolute; width: 40vw; height: 40vw; border-radius: 50%; background: #e9d5ff; filter: blur(90px); top: 40%; left: 30%; opacity: 0.3; animation: floatBg 20s infinite alternate ease-in-out; }
@keyframes floatBg { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(10vw, 10vh) scale(1.1); } }

/* --- 3. TOAST ALERTS (Errors/Success) --- */
.toast-wrapper { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 100000; display: flex; flex-direction: column; gap: 10px; width: 90%; max-width: 400px; pointer-events: none; }
.toast-msg { background: rgba(30, 41, 59, 0.95); backdrop-filter: blur(10px); color: #fff; padding: 16px 20px; border-radius: var(--radius-md); font-weight: 500; font-size: 0.95rem; box-shadow: 0 10px 30px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 12px; animation: slideDown 0.4s var(--spring) forwards; }
.toast-msg.error-toast i { color: #f87171; }
.toast-msg.hide-toast { animation: slideUp 0.3s var(--smooth) forwards; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }

/* --- 4. COUNTRY MODAL (BOTTOM SHEET) --- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 99999; display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity 0.4s var(--smooth); pointer-events: none; }
.modal-backdrop[aria-hidden="false"] { opacity: 1; pointer-events: all; }

.modal-surface { background: var(--bg-card); width: 100%; max-width: var(--app-max-width); border-radius: 32px 32px 0 0; padding: 24px 24px 40px; transform: translateY(100%); transition: transform 0.5s var(--spring); box-shadow: 0 -20px 60px rgba(0,0,0,0.1); }
.modal-backdrop[aria-hidden="false"] .modal-surface { transform: translateY(0); }

.modal-handle { width: 40px; height: 5px; background: var(--border-light); border-radius: var(--radius-pill); margin: 0 auto 24px; }
.modal-header { text-align: center; margin-bottom: 30px; }
.modal-icon-badge { font-size: 3rem; margin-bottom: 12px; }
.modal-header h2 { font-family: 'Clash Display', sans-serif; font-size: 1.8rem; margin-bottom: 8px; color: var(--text-main); }
.modal-header p { color: var(--text-muted); font-size: 1rem; line-height: 1.4; }

.modal-button-stack { display: flex; flex-direction: column; gap: 12px; }
.loc-btn { display: flex; align-items: center; background: var(--bg-page); border: 1.5px solid var(--border-light); padding: 18px 20px; border-radius: var(--radius-md); transition: 0.2s var(--smooth); text-align: left; }
.loc-btn:active { transform: scale(0.97); background: var(--border-light); border-color: var(--border-strong); }
.loc-flag { font-size: 2rem; margin-right: 16px; }
.loc-text { flex: 1; display: flex; flex-direction: column; }
.loc-name { font-size: 1.15rem; font-weight: 700; color: var(--text-main); margin-bottom: 2px; }
.loc-sub { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.loc-arrow { color: var(--border-strong); font-size: 1.2rem; transition: 0.2s; }
.loc-btn:active .loc-arrow { transform: translateX(4px); color: var(--text-main); }

/* --- 5. APP LAYOUT SHELL --- */
.app-layout { max-width: var(--app-max-width); margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; position: relative; }

/* TOP NAV */
.app-nav { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; position: sticky; top: 0; z-index: 90; background: rgba(244, 245, 248, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid rgba(15,23,42,0.03); }
.nav-back { width: 44px; height: 44px; background: rgba(255,255,255,0.7); backdrop-filter: blur(10px); border: 1px solid var(--border-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-main); text-decoration: none; font-size: 1.1rem; transition: 0.2s; }
.nav-back:active { transform: scale(0.9); }
.nav-brand { font-family: 'Clash Display', sans-serif; font-weight: 700; font-size: 1.2rem; display: flex; align-items: center; gap: 8px; color: var(--text-main); }
.nav-region-btn { background: rgba(255,255,255,0.7); backdrop-filter: blur(10px); border: 1px solid var(--border-light); padding: 10px 16px; border-radius: var(--radius-pill); font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); transition: 0.2s; }
.nav-region-btn:active { transform: scale(0.95); }

/* HEADER TITLE WITH INSTAGRAM GRADIENT */
.app-header { padding: 10px 24px 30px; }
.hero-title { font-family: 'Clash Display', sans-serif; font-size: 2.8rem; line-height: 1.1; margin-bottom: 12px; letter-spacing: -0.02em; color: var(--text-main); }
.text-gradient { background: linear-gradient(45deg, var(--brand-ig-gold), var(--brand-ig-pink), var(--brand-ig-purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: inline-block; }
.hero-text { color: var(--text-muted); font-size: 1.05rem; font-weight: 500; line-height: 1.5; }

/* --- 6. STORE PACKAGES (The Cards) --- */
.bento-stack { padding: 0 24px; display: flex; flex-direction: column; gap: 20px; }
.bento-card { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: var(--radius-large); border: 2px solid transparent; box-shadow: 0 8px 30px rgba(0,0,0,0.03); transition: 0.4s var(--smooth); position: relative; overflow: hidden; }
.bento-card::before { content: ''; position: absolute; inset: 0; background: var(--bg-card); opacity: 0; transition: 0.4s; z-index: -1; }

.bento-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding: 24px 24px 0; }
.minimal-header { margin-bottom: 16px; }
.b-icon-wrap { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.insta-purple-theme { background: var(--brand-ig-purple-bg); color: var(--brand-ig-purple); }
.insta-pink-theme { background: var(--brand-ig-pink-bg); color: var(--brand-ig-pink); }
.b-title-wrap h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 2px; color: var(--text-main); }
.b-title-wrap p { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }

/* The Pricing Grid */
.bento-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 24px 24px; }
.pack-btn { background: #f8fafc; border: 2px solid var(--border-light); padding: 16px 12px; border-radius: var(--radius-md); text-align: center; cursor: pointer; transition: 0.2s var(--smooth); user-select: none; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.pack-btn:active { transform: scale(0.96); }

.p-vol { font-family: 'Clash Display', sans-serif; font-size: 1.6rem; font-weight: 700; color: var(--text-main); line-height: 1; transition: 0.2s; }
.p-views { font-size: 0.75rem; font-weight: 700; color: var(--brand-green); text-transform: uppercase; margin-top: 4px; transition: 0.2s; }
.p-price { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); margin-top: 4px; transition: 0.2s; }

/* Skip Button */
.pack-btn.skip-btn { border: 2px dashed var(--border-strong); background: transparent; justify-content: center; min-height: 80px; }
.skip-btn .p-vol { font-size: 1.2rem; color: var(--text-muted); }
.skip-btn:active { background: var(--bg-page); }

/* Selected States */
.pack-btn.selected-purple { background: var(--brand-ig-purple-bg); border-color: var(--brand-ig-purple); }
.pack-btn.selected-purple .p-vol { color: #6d28d9; }
.pack-btn.selected-purple .p-price { color: #5b21b6; }

.pack-btn.selected-pink { background: var(--brand-ig-pink-bg); border-color: var(--brand-ig-pink); }
.pack-btn.selected-pink .p-vol { color: #a21caf; }
.pack-btn.selected-pink .p-price { color: #86198f; }

.pack-btn.skip-btn.selected-skip { border: 2px solid var(--border-strong); background: var(--bg-page); opacity: 0.6; }

/* Split Controls */
.split-controls { margin: -8px 24px 24px; background: #f8fafc; padding: 16px; border-radius: var(--radius-md); display: flex; justify-content: space-between; align-items: center; gap: 12px; animation: slideDown 0.3s var(--smooth); border: 1px solid var(--border-light); }
.split-info label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-main); margin-bottom: 4px; }
.split-info span { font-size: 0.8rem; color: var(--brand-gold); font-weight: 600; }
.split-stepper { display: flex; align-items: center; gap: 12px; background: var(--bg-card); padding: 4px; border-radius: var(--radius-pill); border: 1px solid var(--border-light); box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.split-stepper button { width: 36px; height: 36px; border-radius: 50%; background: #f1f5f9; color: var(--text-main); font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.split-stepper button:active { transform: scale(0.9); background: var(--border-light); }
.split-count { font-family: 'Clash Display', sans-serif; font-size: 1.2rem; font-weight: 700; width: 24px; text-align: center; }

/* --- 7. CLIENT DETAILS MODULE --- */
.details-card { padding-bottom: 24px; border: 1px solid var(--border-light); }
.input-wrapper { padding: 0 24px 24px; }
.fat-input-box { position: relative; display: flex; align-items: center; background: #f8fafc; border-radius: var(--radius-md); padding: 0 16px; z-index: 1; border: 1px solid transparent; }
.input-prefix { color: var(--text-muted); font-size: 1.2rem; z-index: 2; margin-right: 8px; }
.fat-input { width: 100%; padding: 20px 0; font-size: 1.05rem; font-weight: 500; color: var(--text-main); z-index: 2; }
.fat-input::placeholder { color: #94a3b8; }
.focus-ring { position: absolute; inset: 0; border: 2px solid var(--border-light); border-radius: var(--radius-md); transition: 0.3s var(--smooth); z-index: 0; }
.fat-input-box:focus-within .focus-ring { border-color: var(--text-main); box-shadow: 0 4px 15px rgba(15,23,42,0.08); }
.fat-input-box:focus-within { background: var(--bg-card); }

/* Referrer Toggle */
.referrer-wrapper { padding: 20px 24px 0; border-top: 1px dashed var(--border-light); }
.referrer-question { display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; font-weight: 600; color: var(--text-main); }
.ref-pills { display: flex; background: #f8fafc; padding: 4px; border-radius: var(--radius-pill); border: 1px solid var(--border-light); }
.ref-pill { padding: 8px 16px; font-weight: 600; font-size: 0.9rem; color: var(--text-muted); border-radius: var(--radius-pill); transition: 0.3s var(--spring); }
.ref-pill.active { background: var(--bg-card); color: var(--text-main); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

.referrer-slide-box { max-height: 0; opacity: 0; overflow: hidden; transition: all 0.4s var(--spring); }
.referrer-slide-box.is-open { max-height: 100px; opacity: 1; margin-top: 16px; }
.small-fat-box .fat-input { padding: 16px 0; font-size: 1rem; }

.bottom-safe-space { height: 180px; }

/* --- 8. STICKY CHECKOUT DOCK --- */
.checkout-dock { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 100; pointer-events: none; }
.dock-inner { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); padding: 16px 24px 32px; border-top: 1px solid var(--border-light); max-width: var(--app-max-width); margin: 0 auto; box-shadow: 0 -10px 50px rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; pointer-events: all; }
@media(min-width: 540px) { .dock-inner { border-radius: 32px 32px 0 0; border-left: 1px solid var(--border-light); border-right: 1px solid var(--border-light); padding-bottom: 24px; } }

.dock-details { flex: 1; display: flex; flex-direction: column; }
.dock-badges { display: flex; gap: 8px; height: 24px; margin-bottom: 6px; }
.badge { display: none; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill); text-transform: uppercase; align-items: center; gap: 6px; animation: tagIn 0.4s var(--spring); white-space: nowrap; }
.combo-badge { background: var(--brand-green-bg); color: #065f46; border: 1px solid rgba(16,185,129,0.2); }
.max-badge { background: var(--brand-gold-bg); color: #b45309; border: 1px solid rgba(245,158,11,0.3); }
@keyframes tagIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.total-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.price-cluster { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price-strikethrough { font-size: 1.1rem; color: #94a3b8; text-decoration: line-through; font-weight: 600; }
.price-massive { font-family: 'Clash Display', sans-serif; font-size: 2.4rem; font-weight: 700; color: var(--text-main); line-height: 1; letter-spacing: -0.02em; }
.price-currency { font-size: 1rem; font-weight: 600; color: var(--text-muted); }

/* Submit Button */
.action-btn { background: var(--text-main); color: #fff; border-radius: var(--radius-md); padding: 20px 24px; font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; transition: 0.2s var(--smooth); box-shadow: 0 10px 30px rgba(30,41,59,0.15); min-width: 160px; position: relative; overflow: hidden; }
.action-btn::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); transition: 0.5s; }
.action-btn:hover::before { left: 100%; }
.action-btn:active { transform: scale(0.96); box-shadow: 0 4px 15px rgba(30,41,59,0.1); }
.action-btn:disabled { background: var(--text-muted); cursor: not-allowed; transform: none; box-shadow: none; }

/* SVG Spinner */
.btn-spinner-wrap { width: 24px; height: 24px; }
.circular-spinner { animation: rotate 2s linear infinite; width: 100%; height: 100%; }
.spinner-path { stroke: #ffffff; stroke-linecap: round; animation: dash 1.5s ease-in-out infinite; }
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash { 0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; } 50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; } 100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; } }