/* ============================================
   QRCode Monster - iOS Liquid Glass Design
   Premium glassmorphism в стиле Apple
   ============================================ */

:root {
    /* Glass tokens */
    --glass-bg: rgba(255, 255, 255, 0.18);
    --glass-border: rgba(255, 255, 255, 0.35);
    --glass-border-strong: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    --glass-blur: blur(24px);
    --glass-blur-light: blur(12px);
    
    /* Accent palette — мягкая фиолетово-розовая гамма */
    --accent: #5e5ce6;
    --accent-light: rgba(94, 92, 230, 0.15);
    --accent-glow: rgba(94, 92, 230, 0.3);
    
    --success: #34c759;
    --warning: #ff9f0a;
    --danger: #ff453a;
    --info: #5ac8fa;
    
    /* Text on glass */
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.45);
    
    /* Shadows */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 60px rgba(94, 92, 230, 0.15);
    --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    
    /* Radius — скруглённые как в iOS */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 32px;
    
    --transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============ DYNAMIC BACKGROUND ============ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    
    background: 
        radial-gradient(ellipse 80% 60% at 0% 20%, rgba(175, 82, 222, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 100% 0%, rgba(0, 200, 200, 0.35) 0%, transparent 50%),
        radial-gradient(ellipse 70% 40% at 50% 100%, rgba(255, 159, 10, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse 50% 50% at 30% 60%, rgba(94, 92, 230, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse 90% 70% at 80% 40%, rgba(255, 69, 58, 0.15) 0%, transparent 50%);
    
    background-color: #0a0a1a;
    background-size: 100% 100%;
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* Floating glass orbs — мягкие светящиеся сферы */
body::before {
    content: '';
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle, rgba(94, 92, 230, 0.15) 0%, transparent 70%);
    top: -150px;
    right: -100px;
    animation: orbFloat 25s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle, rgba(0, 200, 200, 0.1) 0%, transparent 70%);
    bottom: -200px;
    left: -150px;
    animation: orbFloat 30s ease-in-out infinite reverse;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, -40px) scale(1.05); }
    66% { transform: translate(-30px, 30px) scale(0.95); }
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ============ TOP BAR — iOS Style ============ */
.top-bar {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 20px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.logo-text h1 {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.2px;
    color: rgba(255, 255, 255, 0.95);
}

.main-nav {
    display: flex;
    gap: 4px;
}

.main-nav a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    background: transparent;
}

.main-nav a:hover,
.main-nav a.active {
    color: white;
    background: rgba(255, 255, 255, 0.12);
}

.mobile-toggle {
    display: none;
    cursor: pointer;
    font-size: 22px;
    padding: 6px;
    color: rgba(255, 255, 255, 0.8);
}

/* ============ GENERATOR SECTION ============ */
.generator-section {
    padding: 24px 0 60px;
}

.generator-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: start;
}

/* ============ GLASS CARD — универсальный ============ */
.glass-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: var(--glass-blur-light);
    -webkit-backdrop-filter: var(--glass-blur-light);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), var(--shadow-inner);
    overflow: hidden;
}

/* Settings */
.generator-settings {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: var(--glass-blur-light);
    -webkit-backdrop-filter: var(--glass-blur-light);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), var(--shadow-inner);
    overflow: hidden;
}

/* Type Selector — iOS pills */
.type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.type-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition);
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    letter-spacing: 0.1px;
}

.type-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.06);
}

.type-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Settings Panels */
.settings-panel {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-panel:last-child {
    border-bottom: none;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 18px;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 0;
}

.panel-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.panel-header h3 {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.1px;
}

.panel-header i:first-child {
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
}

.toggle-icon {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease;
}

.settings-panel.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.panel-body {
    padding: 0 18px 18px;
    display: block;
}

.settings-panel.collapsed .panel-body {
    display: none;
}

/* ============ FORM ELEMENTS — iOS inspired ============ */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
    letter-spacing: 0.1px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transition: var(--transition);
    font-family: inherit;
    outline: none;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.25);
    font-weight: 400;
}

.form-control:focus {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

select.form-control {
    appearance: auto;
    color: white;
}

select.form-control option {
    background: #1a1a2e;
    color: white;
}

textarea.form-control {
    resize: vertical;
    min-height: 56px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .col-6 {
    flex: 0 0 calc(50% - 6px);
}

.form-group small {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 4px;
    font-weight: 400;
}

.hidden {
    display: none !important;
}

/* ============ UTM SECTION ============ */
.utm-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 14px;
}

.utm-info i {
    color: rgba(255, 255, 255, 0.4);
    font-size: 15px;
}

.utm-required {
    color: var(--danger);
    font-weight: 600;
}

/* UTM Presets */
.utm-presets {
    margin-bottom: 14px;
}

.utm-presets > label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.preset-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.preset-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition);
    color: rgba(255, 255, 255, 0.55);
}

.preset-tag:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border-color: rgba(255, 255, 255, 0.15);
}

/* UTM Preview */
.utm-preview {
    margin-top: 4px;
}

.utm-preview > label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
}

.preview-box {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    word-break: break-all;
    min-height: 38px;
    font-family: 'SF Mono', 'Courier New', monospace;
    margin-bottom: 8px;
    line-height: 1.5;
}

/* ============ DESIGN SECTION ============ */
.color-section {
    margin-bottom: 16px;
}

.color-section > label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    margin-top: 12px;
}

.color-section > label:first-child {
    margin-top: 0;
}

.color-group {
    display: flex;
    gap: 14px;
    margin-bottom: 12px;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
}

.radio-label input[type="radio"] {
    accent-color: white;
    width: 14px;
    height: 14px;
}

.color-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.color-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-input-wrap input[type="color"] {
    width: 36px;
    height: 36px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
}

.color-input-wrap input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-input-wrap input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }

.color-hex {
    width: 76px;
    padding: 8px;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', 'Courier New', monospace;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.04);
    color: white;
    outline: none;
}

.color-hex:focus {
    border-color: rgba(255, 255, 255, 0.25);
}

/* Logo */
.logo-section {
    margin-top: 16px;
}

.logo-section > label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.logo-upload-area {
    width: 100px;
    height: 100px;
    border: 1.5px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.logo-upload-area:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

.logo-upload-area i {
    font-size: 26px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 4px;
}

.logo-upload-area span {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    padding: 0 8px;
}

.logo-upload-area img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

/* ============ PREVIEW CARD ============ */
.generator-preview {
    position: sticky;
    top: 80px;
}

.preview-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: var(--glass-blur-light);
    -webkit-backdrop-filter: var(--glass-blur-light);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), var(--shadow-inner);
    padding: 22px;
    text-align: center;
}

.preview-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 18px;
}

#qrcode {
    display: flex;
    align-items: center;
    justify-content: center;
}

#qrcode img, #qrcode canvas {
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
    border-radius: 6px;
}

.preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: var(--radius-md);
}

.preview-overlay i {
    font-size: 28px;
    color: rgba(255, 255, 255, 0.7);
}

.preview-overlay span {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    font-size: 14px;
}

/* Size Control */
.size-control {
    margin-bottom: 18px;
}

.size-control label {
    font-size: 12px;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.size-slider {
    display: flex;
    align-items: center;
    gap: 10px;
}

.size-slider span {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
    min-width: 36px;
}

.size-slider input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    outline: none;
}

.size-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: none;
}

.size-value {
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.85);
}

/* ============ BUTTONS — iOS Style ============ */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
    letter-spacing: 0.1px;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
    border-radius: 14px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 11px;
    border-radius: 8px;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.btn-success {
    background: rgba(52, 199, 89, 0.2);
    color: white;
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.btn-success:hover {
    background: rgba(52, 199, 89, 0.32);
    transform: translateY(-1px);
}

.btn-info {
    background: rgba(90, 200, 250, 0.15);
    color: white;
    border: 1px solid rgba(90, 200, 250, 0.15);
}

.btn-info:hover {
    background: rgba(90, 200, 250, 0.28);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.btn-danger {
    background: rgba(255, 69, 58, 0.15);
    color: white;
    border: 1px solid rgba(255, 69, 58, 0.15);
}

.btn-danger:hover {
    background: rgba(255, 69, 58, 0.28);
    transform: translateY(-1px);
}

.download-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.status-message {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 10px;
    min-height: 20px;
    font-weight: 400;
}

/* ============ FAQ ============ */
.faq-section {
    padding: 60px 0 80px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: white;
    letter-spacing: -0.3px;
}

.section-title span {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

.faq-list {
    max-width: 680px;
    margin: 0 auto;
}

.faq-item {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: var(--glass-blur-light);
    -webkit-backdrop-filter: var(--glass-blur-light);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    overflow: hidden;
    transition: var(--transition);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    user-select: none;
    color: rgba(255, 255, 255, 0.85);
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.03);
}

.faq-question i {
    transition: transform 0.3s ease;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.25);
}

.faq-item.open .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.35s ease;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.7;
}

.faq-item.open .faq-answer {
    padding: 0 20px 16px;
    max-height: 300px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .generator-wrapper {
        grid-template-columns: 1fr;
    }

    .generator-preview {
        position: static;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: var(--glass-blur);
        -webkit-backdrop-filter: var(--glass-blur);
        flex-direction: column;
        padding: 12px;
        gap: 2px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .main-nav.open {
        display: flex;
    }

    .mobile-toggle {
        display: block;
    }

    .generator-section {
        padding: 14px 0 40px;
    }

    .type-selector {
        padding: 12px 14px;
        gap: 4px;
    }

    .type-btn {
        font-size: 11px;
        padding: 5px 11px;
    }

    .download-group {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .logo-text h1 {
        font-size: 13px;
    }

    .section-title {
        font-size: 22px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .col-6 {
        flex: 1;
    }
}
