/* ==================== BETECH ULTRA ENGINE CSS v6.1 ==================== */
/* ОГЛАВЛЕНИЕ:
   1-50   : CSS переменные и настройки
   51-100 : Wave Preloader
   101-200: UI Popup (основной попап)
   201-250: Content Manager (uc-блоки)
   251-300: Price Manager (цены и бейджи)
   301-350: Badges System (система бейджей)
   351-400: Dashboard (партнерский кабинет)
   401-450: Адаптивность попапа
   451-500: Совместимость с Tilda
   501-550: Утилитные классы
   551-600: Анимации и переходы
   601-650: Безопасность и доступность
*/
/* ===================================================================== */

/* 1-50: CSS ПЕРЕМЕННЫЕ */
:root {
    --primary: #e77937; --primary-dark: #d2692e; --primary-light: #f5a16c; --primary-ultralight: #fef5ef;
    --accent: #4A6CF7; --accent-dark: #3a5ce5; --accent-light: #6b89f9;
    --secondary: #303030; --light: #f8f8f8; --dark: #1a1a1a; --gray: #666666; --gray-light: #e0e0e0; --gray-ultralight: #f5f5f5;
    --success: #27AE60; --warning: #FF9F43; --error: #E74C3C; --info: #3498DB;
    --font-family: 'Play', Arial, sans-serif;
    --font-size-xs: 0.75rem; --font-size-sm: 0.875rem; --font-size-base: 1rem; --font-size-lg: 1.125rem; --font-size-xl: 1.25rem; --font-size-2xl: 1.5rem; --font-size-3xl: 1.875rem;
    --space-xs: 0.25rem; --space-sm: 0.5rem; --space-md: 1rem; --space-lg: 1.5rem; --space-xl: 2rem;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1); --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.1); --shadow-lg: 0 10px 15px rgba(0,0,0,0.07), 0 4px 6px rgba(0,0,0,0.05); --shadow-primary: 0 4px 12px rgba(231, 121, 55, 0.2);
    --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --radius-xl: 18px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1); --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 51-100: WAVE PRELOADER */
.betech-wave-preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--light); z-index: 9999; display: flex; align-items: center; justify-content: center; font-family: var(--font-family); }
.betech-wave-container { text-align: center; }
.betech-wave-letter { display: inline-block; position: relative; font-size: 2.5rem; font-weight: 700; color: var(--primary); margin: 0 2px; }
.betech-wave-fill { position: absolute; top: 0; left: 0; color: var(--primary); overflow: hidden; width: 0%; animation: betech-wave-fill 1.5s ease-in-out forwards; }
@keyframes betech-wave-fill { 0% { width: 0%; } 100% { width: 100%; } }
.betech-wave-glow { width: 100px; height: 4px; background: var(--primary); margin: 20px auto; border-radius: 50%; animation: betech-wave-glow 2s ease-in-out infinite; }
@keyframes betech-wave-glow { 0%, 100% { opacity: 0.3; transform: scaleX(0.8); } 50% { opacity: 1; transform: scaleX(1.2); } }
.betech-status { margin-top: var(--space-lg); color: var(--secondary); font-size: var(--font-size-sm); }

/* 101-200: UI POPUP */
.betech-popup-overlay { position: fixed !important; top: 0 !important; left: 0 !important; width: 100vw !important; height: 100vh !important; background: rgba(0, 0, 0, 0.7) !important; display: flex !important; align-items: center !important; justify-content: center !important; z-index: 10000 !important; padding: 20px !important; font-family: var(--font-family) !important; }
.betech-popup-modal { background: white !important; border-radius: 24px !important; box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3) !important; max-width: 900px !important; width: 95% !important; max-height: 90vh !important; overflow: hidden !important; position: relative !important; }
.betech-popup-header { padding: 40px 40px 20px 40px !important; text-align: center !important; position: relative !important; border-bottom: 1px solid var(--gray-light) !important; }
.betech-popup-title { font-size: 24px !important; font-weight: 700 !important; color: var(--secondary) !important; margin-bottom: 8px !important; font-family: var(--font-family) !important; }
.betech-popup-subtitle { font-size: 16px !important; color: var(--gray) !important; margin: 0 !important; font-family: var(--font-family) !important; }
.betech-popup-close { position: absolute !important; top: 20px !important; right: 20px !important; width: 40px !important; height: 40px !important; border: none !important; background: var(--gray-ultralight) !important; border-radius: 50% !important; cursor: pointer !important; display: flex !important; align-items: center !important; justify-content: center !important; color: var(--gray) !important; font-size: 20px !important; transition: all var(--transition-base) !important; }
.betech-popup-close:hover { background: var(--primary) !important; color: white !important; transform: rotate(90deg) !important; }
.betech-popup-content { display: grid !important; grid-template-columns: repeat(5, 1fr) !important; gap: 12px !important; padding: 30px 40px !important; width: 100% !important; box-sizing: border-box !important; }
.betech-segment-option { background: var(--gray-ultralight) !important; border: 2px solid var(--gray-light) !important; border-radius: 16px !important; padding: 20px 12px !important; text-align: center !important; cursor: pointer !important; transition: all var(--transition-base) !important; min-height: 140px !important; display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; font-family: var(--font-family) !important; width: 100% !important; box-sizing: border-box !important; }
.betech-segment-option:hover { border-color: var(--primary) !important; transform: translateY(-4px) !important; box-shadow: var(--shadow-primary) !important; }
.betech-segment-icon { font-size: 28px !important; margin-bottom: 12px !important; width: 60px !important; height: 60px !important; display: flex !important; align-items: center !important; justify-content: center !important; background: var(--primary-ultralight) !important; border-radius: 15px !important; transition: all var(--transition-base) !important; }
.betech-segment-option:hover .betech-segment-icon { background: var(--primary) !important; color: white !important; transform: scale(1.1) !important; }
.betech-segment-name { font-size: 13px !important; font-weight: 600 !important; color: var(--secondary) !important; margin-bottom: 6px !important; line-height: 1.3 !important; font-family: var(--font-family) !important; }
.betech-segment-desc { font-size: 11px !important; color: var(--gray) !important; line-height: 1.4 !important; margin: 0 !important; font-family: var(--font-family) !important; }

/* 201-250: CONTENT MANAGER */
.uc-visible { display: block !important; visibility: visible !important; opacity: 1 !important; height: auto !important; overflow: visible !important; }
.uc-hidden { display: none !important; visibility: hidden !important; opacity: 0 !important; height: 0 !important; overflow: hidden !important; }

/* 251-300: PRICE MANAGER */
.betech-hidden-controls { display: none !important; }
.betech-rrc-badge, .betech-discount-badge { display: inline-block; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-sm); font-size: var(--font-size-xs); font-weight: 600; margin-left: var(--space-sm); font-family: var(--font-family); }
.betech-rrc-badge { background: var(--gray-ultralight); color: var(--gray); text-decoration: line-through; }
.betech-discount-badge { background: var(--success); color: white; }

/* 301-350: BADGES SYSTEM */
.betech-badge { display: inline-flex; align-items: center; justify-content: center; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-md); font-size: var(--font-size-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; font-family: var(--font-family); min-height: 24px; }
.betech-badge-secondary { background: var(--gray-ultralight); color: var(--gray); }
.betech-badge-success { background: var(--success); color: white; }
.betech-badge-warning { background: var(--warning); color: white; }
.betech-badge-primary { background: var(--primary); color: white; }
.betech-badge-accent { background: var(--accent); color: white; }
.betech-badge-info { background: var(--info); color: white; }

/* 351-400: DASHBOARD */
.betech-dashboard-item { background: white; border-radius: var(--radius-lg); padding: var(--space-xl); margin-bottom: var(--space-lg); border: 1px solid var(--gray-light); box-shadow: var(--shadow-sm); }
.betech-dashboard-title h2 { color: var(--secondary); margin-bottom: var(--space-xs); font-size: var(--font-size-2xl); }
.betech-dashboard-subtitle { color: var(--gray); font-size: var(--font-size-sm); margin-bottom: var(--space-lg); }
.betech-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-xl); }
.betech-stat-card { background: var(--gray-ultralight); padding: var(--space-lg); border-radius: var(--radius-md); text-align: center; }
.betech-stat-value { font-size: var(--font-size-2xl); font-weight: 700; color: var(--primary); margin-bottom: var(--space-xs); }
.betech-stat-label { font-size: var(--font-size-sm); color: var(--gray); }
.betech-partner-tools { background: var(--primary-ultralight); padding: var(--space-lg); border-radius: var(--radius-md); border: 1px solid var(--primary-light); }
.betech-ref-link { display: flex; gap: var(--space-sm); margin: var(--space-md) 0; }
.betech-ref-link input { flex: 1; padding: var(--space-sm) var(--space-md); border: 1px solid var(--gray-light); border-radius: var(--radius-sm); font-family: monospace; font-size: var(--font-size-sm); }
.betech-ref-link button { background: var(--primary); color: white; border: none; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font-family); font-weight: 600; transition: background var(--transition-base); }
.betech-ref-link button:hover { background: var(--primary-dark); }

/* 401-450: АДАПТИВНОСТЬ ПОПАПА */
@media (max-width: 1000px) { .betech-popup-content { grid-template-columns: repeat(4, 1fr) !important; } }
@media (max-width: 768px) { .betech-popup-modal { max-width: 95% !important; } .betech-popup-content { grid-template-columns: repeat(3, 1fr) !important; padding: 25px !important; gap: 10px !important; } .betech-segment-option { padding: 16px 10px !important; min-height: 130px !important; } .betech-segment-icon { width: 50px !important; height: 50px !important; font-size: 22px !important; } }
@media (max-width: 480px) { .betech-popup-content { grid-template-columns: repeat(2, 1fr) !important; padding: 20px !important; } }
@media (max-width: 360px) { .betech-popup-content { grid-template-columns: 1fr !important; } }

/* 451-500: СОВМЕСТИМОСТЬ С TILDA */
#allrecords .betech-popup-overlay { z-index: 10000 !important; }
.t-store__card .betech-badge, .t-store__prod-popup__price-currency + .betech-rrc-badge, .t-store__prod-popup__price-currency + .betech-discount-badge { vertical-align: middle; }
.t-form__hidden.betech-partner-field { display: none !important; }

/* 501-550: УТИЛИТНЫЕ КЛАССЫ */
.betech-text-primary { color: var(--primary) !important; } .betech-text-accent { color: var(--accent) !important; } .betech-text-success { color: var(--success) !important; } .betech-text-warning { color: var(--warning) !important; } .betech-text-error { color: var(--error) !important; }
.betech-bg-primary { background-color: var(--primary) !important; } .betech-bg-accent { background-color: var(--accent) !important; } .betech-bg-primary-light { background-color: var(--primary-ultralight) !important; }
.betech-shadow-sm { box-shadow: var(--shadow-sm) !important; } .betech-shadow-md { box-shadow: var(--shadow-md) !important; } .betech-shadow-lg { box-shadow: var(--shadow-lg) !important; }
.betech-rounded-sm { border-radius: var(--radius-sm) !important; } .betech-rounded-md { border-radius: var(--radius-md) !important; } .betech-rounded-lg { border-radius: var(--radius-lg) !important; }

/* 551-600: АНИМАЦИИ И ПЕРЕХОДЫ */
.betech-fade-in { animation: betech-fade-in var(--transition-base); } @keyframes betech-fade-in { from { opacity: 0; } to { opacity: 1; } }
.betech-slide-up { animation: betech-slide-up var(--transition-base); } @keyframes betech-slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* 601-650: БЕЗОПАСНОСТЬ И ДОСТУПНОСТЬ */
.betech-segment-option:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.betech-popup-close:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .betech-wave-letter, .betech-wave-fill, .betech-wave-glow, .betech-popup-modal, .betech-segment-option { animation: none; transition: none; } }

/* 651-670: ПРОИЗВОДИТЕЛЬНОСТЬ */
.betech-popup-overlay, .betech-wave-preloader { will-change: opacity; transform: translateZ(0); }