/* ================================================================== */
/*  Professional QR Code Generator — Stylesheet                       */
/*  Modern SaaS UI · Glassmorphism · Dark / Light themes              */
/* ================================================================== */

/* ------------------------------------------------------------------ */
/*  Google Font Import                                                */
/* ------------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ------------------------------------------------------------------ */
/*  CSS Custom Properties (Light Theme)                               */
/* ------------------------------------------------------------------ */
/* ------------------------------------------------------------------ */
/*  CSS Custom Properties (White-Based Dynamic Theme Default)         */
/* ------------------------------------------------------------------ */
:root, [data-theme="light"] {
    /* Default Brand palette (Indigo Silk) */
    --brand-primary: #6c5ce7;
    --brand-primary-light: #a29bfe;
    --brand-primary-dark: #5041c2;
    --brand-accent: #00cec9;
    --brand-accent-light: #81ecec;

    /* Surfaces - Crisp Luminous White Base */
    --bg-body: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.88);
    --bg-card-solid: #ffffff;
    --bg-input: #f1f5f9;
    --bg-input-focus: #ffffff;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-on-primary: #ffffff;

    /* Borders */
    --border-color: rgba(226, 232, 240, 0.9);
    --border-color-focus: var(--brand-primary);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 36px rgba(15, 23, 42, 0.08);
    --shadow-xl: 0 20px 50px rgba(15, 23, 42, 0.1);
    --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.18);

    /* Glass */
    --glass-blur: 24px;
    --glass-border: rgba(255, 255, 255, 0.9);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Gradient */
    --gradient-brand: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light), var(--brand-accent));
    --gradient-hero: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 50%, var(--brand-accent) 100%);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(248,250,252,0.75));

    /* Toast */
    --toast-success: #10b981;
    --toast-error: #ef4444;
    --toast-info: #3b82f6;
    --toast-warning: #f59e0b;

    /* Misc */
    --header-height: 72px;
    --footer-height: 60px;
}

/* ------------------------------------------------------------------ */
/*  White Dynamic Accent Presets                                      */
/* ------------------------------------------------------------------ */
[data-accent="emerald"] {
    --brand-primary: #059669;
    --brand-primary-light: #6ee7b7;
    --brand-primary-dark: #047857;
    --brand-accent: #10b981;
    --brand-accent-light: #a7f3d0;
    --shadow-glow: 0 0 30px rgba(16, 185, 129, 0.2);
}

[data-accent="sapphire"] {
    --brand-primary: #2563eb;
    --brand-primary-light: #93c5fd;
    --brand-primary-dark: #1d4ed8;
    --brand-accent: #06b6d4;
    --brand-accent-light: #67e8f9;
    --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.2);
}

[data-accent="rose"] {
    --brand-primary: #e11d48;
    --brand-primary-light: #fda4af;
    --brand-primary-dark: #be123c;
    --brand-accent: #f59e0b;
    --brand-accent-light: #fde68a;
    --shadow-glow: 0 0 30px rgba(225, 29, 72, 0.2);
}

[data-accent="monochrome"] {
    --brand-primary: #0f172a;
    --brand-primary-light: #64748b;
    --brand-primary-dark: #020617;
    --brand-accent: #334155;
    --brand-accent-light: #94a3b8;
    --shadow-glow: 0 0 30px rgba(15, 23, 42, 0.15);
}

/* ------------------------------------------------------------------ */
/*  Dark Theme Override                                               */
/* ------------------------------------------------------------------ */
[data-theme="dark"] {
    --bg-body: #0f0f1a;
    --bg-card: rgba(30, 30, 50, 0.75);
    --bg-card-solid: #1a1a2e;
    --bg-input: #1e1e34;
    --bg-input-focus: #252542;

    --text-primary: #eaeaff;
    --text-secondary: #9e9eb8;
    --text-muted: #6b6b8a;

    --border-color: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.08);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.35);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(108, 92, 231, 0.25);

    --gradient-card: linear-gradient(145deg, rgba(30,30,50,0.9), rgba(20,20,40,0.6));
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background var(--transition-base), color var(--transition-base);
    overflow-x: hidden;
}

/* ------------------------------------------------------------------ */
/*  Animated Background                                               */
/* ------------------------------------------------------------------ */
.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-decoration .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
    animation: floatOrb 18s ease-in-out infinite alternate;
}

.bg-decoration .orb:nth-child(1) {
    width: 500px;
    height: 500px;
    background: var(--brand-primary);
    top: -120px;
    right: -120px;
    animation-delay: 0s;
}

.bg-decoration .orb:nth-child(2) {
    width: 400px;
    height: 400px;
    background: var(--brand-accent);
    bottom: -80px;
    left: -80px;
    animation-delay: -6s;
}

.bg-decoration .orb:nth-child(3) {
    width: 300px;
    height: 300px;
    background: var(--brand-primary-light);
    top: 50%;
    left: 50%;
    animation-delay: -12s;
}

@keyframes floatOrb {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(40px, -30px) scale(1.08); }
    100% { transform: translate(-30px, 40px) scale(0.95); }
}

[data-theme="dark"] .bg-decoration .orb {
    opacity: 0.12;
}

/* ------------------------------------------------------------------ */
/*  Header                                                            */
/* ------------------------------------------------------------------ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    background: var(--bg-card);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-base), box-shadow var(--transition-base);
}

.app-header .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-logo-img {
    height: 44px;
    width: 44px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
    transition: transform var(--transition-fast), filter var(--transition-fast);
}

.brand:hover .brand-logo-img {
    transform: scale(1.06) rotate(-2deg);
    filter: drop-shadow(0 4px 14px rgba(37, 99, 235, 0.3));
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.brand-zen {
    color: var(--text-primary);
    font-weight: 800;
}

.brand-qr {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.brand-tagline {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-left: 6px;
}

/* Header Actions & Accent Selector */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.white-accent-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.white-accent-selector:hover {
    border-color: var(--brand-primary-light);
}

.accent-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.accent-pills {
    display: flex;
    align-items: center;
    gap: 6px;
}

.accent-pill {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--pill-color);
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    padding: 0;
    outline: none;
}

.accent-pill:hover {
    transform: scale(1.25);
}

.accent-pill.active {
    border-color: var(--bg-card-solid);
    box-shadow: 0 0 0 2px var(--pill-color);
    transform: scale(1.15);
}

[data-theme="dark"] .white-accent-selector {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(0.5);
}

/* Mouse Ambient Tracker Glow */
.mouse-glow {
    position: fixed;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--brand-primary-light) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0.12;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 0;
    transition: opacity var(--transition-slow), width var(--transition-slow);
}

[data-theme="dark"] .mouse-glow {
    opacity: 0.05;
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    width: 52px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
    display: flex;
    align-items: center;
    padding: 2px;
}

.theme-toggle:hover {
    border-color: var(--brand-primary-light);
}

.theme-toggle .toggle-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gradient-brand);
    box-shadow: 0 2px 6px rgba(108, 92, 231, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    transition: transform var(--transition-base);
}

[data-theme="dark"] .theme-toggle .toggle-thumb {
    transform: translateX(24px);
}

/* ------------------------------------------------------------------ */
/*  Main Content                                                      */
/* ------------------------------------------------------------------ */
.app-main {
    flex: 1;
    position: relative;
    z-index: 1;
    padding: 40px 0 60px;
}

/* Page Title */
.page-title {
    text-align: center;
    margin-bottom: 40px;
}

.page-title h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-title p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ------------------------------------------------------------------ */
/*  Glass Card                                                        */
/* ------------------------------------------------------------------ */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    transition: background var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.glass-card:hover {
    box-shadow: var(--shadow-xl);
}

/* ------------------------------------------------------------------ */
/*  URL Input Group                                                   */
/* ------------------------------------------------------------------ */
.url-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
}

.url-input-group .input-wrapper {
    flex: 1;
    position: relative;
}

.url-input-group .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    transition: color var(--transition-fast);
    z-index: 2;
}

.url-input-group input {
    width: 100%;
    padding: 14px 18px 14px 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.url-input-group input::placeholder {
    color: var(--text-muted);
}

.url-input-group input:focus {
    border-color: var(--brand-primary);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.url-input-group input:focus + .input-icon,
.url-input-group input:focus ~ .input-icon {
    color: var(--brand-primary);
}

/* ------------------------------------------------------------------ */
/*  Buttons                                                           */
/* ------------------------------------------------------------------ */
.btn-generate {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--gradient-brand);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.3);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(108, 92, 231, 0.4);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-generate .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-generate.loading .spinner {
    display: inline-block;
}

.btn-generate.loading .btn-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Secondary buttons */
.btn-secondary {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card-solid);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    border-color: var(--brand-primary-light);
    background: var(--bg-input);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-icon {
    width: 40px;
    height: 44px;
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card-solid);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    border-color: var(--brand-primary-light);
    color: var(--brand-primary);
    transform: translateY(-1px);
}

.btn-download {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card-solid);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-download:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: rgba(108, 92, 231, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-download:active {
    transform: translateY(0);
}

.btn-download i {
    font-size: 16px;
}

.btn-reset {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--toast-error);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--toast-error);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-reset:hover {
    background: var(--toast-error);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(225, 112, 85, 0.3);
}

.btn-reset:active {
    transform: translateY(0);
}

/* ------------------------------------------------------------------ */
/*  Customization Panel                                               */
/* ------------------------------------------------------------------ */
.customization-panel {
    margin-top: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.panel-header .chevron {
    font-size: 14px;
    color: var(--text-muted);
    transition: transform var(--transition-base);
}

.panel-header.collapsed .chevron {
    transform: rotate(-90deg);
}

.panel-body {
    overflow: hidden;
    transition: max-height var(--transition-slow), opacity var(--transition-slow);
    max-height: 1200px;
    opacity: 1;
}

.panel-body.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Form groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.form-group label .label-hint {
    font-weight: 400;
    text-transform: none;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Size pills */
.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.size-pill {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.size-pill:hover {
    border-color: var(--brand-primary-light);
    color: var(--brand-primary);
}

.size-pill.active {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(108, 92, 231, 0.25);
}

/* Color pickers */
.color-picker-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.color-picker-wrapper {
    flex: 1;
    min-width: 120px;
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input-row input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 42px;
    height: 42px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px;
    background: var(--bg-input);
    transition: border-color var(--transition-fast);
}

.color-input-row input[type="color"]:hover {
    border-color: var(--brand-primary-light);
}

.color-input-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-input-row input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-input-row .color-hex {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    outline: none;
    transition: border-color var(--transition-fast);
}

.color-input-row .color-hex:focus {
    border-color: var(--brand-primary);
}

/* Range sliders */
.range-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
}

.range-wrapper input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    transition: background var(--transition-fast);
}

.range-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient-brand);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
    transition: transform var(--transition-fast);
}

.range-wrapper input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.range-wrapper input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient-brand);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.range-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--brand-primary);
    background: rgba(108, 92, 231, 0.08);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

/* Error correction pills */
.ec-options {
    display: flex;
    gap: 8px;
}

.ec-pill {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.ec-pill .ec-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

.ec-pill:hover {
    border-color: var(--brand-primary-light);
    color: var(--brand-primary);
}

.ec-pill.active {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(108, 92, 231, 0.25);
}

.ec-pill.active .ec-label {
    color: rgba(255, 255, 255, 0.7);
}

.ec-pill.auto-upgraded {
    border-color: var(--brand-accent);
    background: var(--brand-accent);
    color: #fff;
}

.ec-pill.auto-upgraded .ec-label {
    color: rgba(255, 255, 255, 0.7);
}

/* ------------------------------------------------------------------ */
/*  Logo Upload                                                       */
/* ------------------------------------------------------------------ */
.logo-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.logo-upload-area:hover,
.logo-upload-area.drag-over {
    border-color: var(--brand-primary);
    background: rgba(108, 92, 231, 0.04);
}

/* Preset logo button */
.logo-preset-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-preset-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    background: var(--bg-card-solid);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-preset-logo:hover {
    border-color: var(--brand-primary);
    background: var(--bg-input);
    color: var(--brand-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-preset-icon {
    height: 20px;
    width: 44px;
    object-fit: contain;
}

.logo-upload-area.drag-over {
    border-style: solid;
    background: rgba(108, 92, 231, 0.08);
}

.logo-upload-area .upload-icon {
    font-size: 32px;
    color: var(--text-muted);
    margin-bottom: 8px;
    transition: color var(--transition-fast);
}

.logo-upload-area:hover .upload-icon {
    color: var(--brand-primary);
}

.logo-upload-area .upload-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.logo-upload-area .upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logo-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.logo-preview-wrapper {
    display: none;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-top: 12px;
}

.logo-preview-wrapper.visible {
    display: flex;
}

.logo-preview-wrapper img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 4px;
}

.logo-preview-wrapper .logo-info {
    flex: 1;
}

.logo-preview-wrapper .logo-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.logo-preview-wrapper .logo-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logo-preview-wrapper .btn-remove-logo {
    background: none;
    border: none;
    color: var(--toast-error);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 50%;
    transition: background var(--transition-fast);
}

.logo-preview-wrapper .btn-remove-logo:hover {
    background: rgba(225, 112, 85, 0.1);
}

.logo-size-slider {
    display: none;
    margin-top: 12px;
}

.logo-size-slider.visible {
    display: block;
}

/* ------------------------------------------------------------------ */
/*  QR Preview                                                        */
/* ------------------------------------------------------------------ */
.qr-preview-section {
    text-align: center;
}

.qr-preview-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.qr-placeholder {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    transition: all var(--transition-base);
    margin-bottom: 24px;
}

.qr-placeholder i {
    font-size: 48px;
    opacity: 0.3;
}

.qr-placeholder span {
    font-size: 0.9rem;
}

.qr-preview-image {
    display: none;
    width: 100%;
    max-width: 320px;
    margin-bottom: 24px;
    position: relative;
}

.qr-preview-image.visible {
    display: block;
    animation: fadeInScale 0.4s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.qr-preview-image img {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    background: #fff;
    padding: 8px;
}

/* Download buttons grid */
.download-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-bottom: 16px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 16px;
}

.action-buttons .btn-secondary {
    flex: 1;
    justify-content: center;
}

/* ------------------------------------------------------------------ */
/*  Section Labels                                                    */
/* ------------------------------------------------------------------ */
.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ------------------------------------------------------------------ */
/*  Toast Notifications                                               */
/* ------------------------------------------------------------------ */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    animation: toastIn 0.35s ease-out;
    transition: opacity var(--transition-base), transform var(--transition-base);
}

.toast.leaving {
    animation: toastOut 0.3s ease-in forwards;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast.toast-success .toast-icon { color: var(--toast-success); }
.toast.toast-error .toast-icon { color: var(--toast-error); }
.toast.toast-info .toast-icon { color: var(--toast-info); }
.toast.toast-warning .toast-icon { color: var(--toast-warning); }

.toast-message {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
    transition: color var(--transition-fast);
}

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

@keyframes toastIn {
    from { opacity: 0; transform: translateX(60px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(60px); }
}

/* ------------------------------------------------------------------ */
/*  Footer                                                            */
/* ------------------------------------------------------------------ */
.app-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}

.app-footer a {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/*  Scrollbar                                                         */
/* ------------------------------------------------------------------ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ------------------------------------------------------------------ */
/*  Loading Overlay                                                   */
/* ------------------------------------------------------------------ */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.loading-overlay.visible {
    display: flex;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(108, 92, 231, 0.15);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ------------------------------------------------------------------ */
/*  Responsive                                                        */
/* ------------------------------------------------------------------ */
/*  Responsive Design System                                          */
/* ------------------------------------------------------------------ */

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

.glass-card {
    max-width: 100%;
    box-sizing: border-box;
}

/* Large Tablets & Laptops (max-width: 991px) */
@media (max-width: 991px) {
    .app-main {
        padding: 24px 0 40px;
    }

    .page-title {
        margin-bottom: 28px;
    }

    .page-title h1 {
        font-size: 1.85rem;
    }

    .glass-card {
        padding: 24px;
    }

    .qr-preview-card {
        position: static;
    }
}

/* Medium Tablets & Mobile Landscape (max-width: 767px) */
@media (max-width: 767px) {
    :root {
        --header-height: 64px;
    }

    .app-header .container {
        padding: 0 12px;
        gap: 8px;
    }

    .brand {
        gap: 8px;
        min-width: 0;
    }

    .brand-text {
        font-size: 1rem;
        white-space: nowrap;
    }

    .brand-logo-img {
        height: 36px;
        width: 36px;
    }

    .header-actions {
        gap: 8px;
        flex-shrink: 0;
    }

    .white-accent-selector {
        padding: 3px 6px;
        gap: 6px;
    }

    .accent-label {
        display: none !important;
    }

    .accent-pill {
        width: 18px;
        height: 18px;
    }

    .url-input-group {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .url-input-group .input-wrapper {
        width: 100%;
    }

    .url-input-group .btn-generate {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }

    .page-title h1 {
        font-size: 1.5rem;
    }

    .page-title p {
        font-size: 0.9rem;
    }

    .glass-card {
        padding: 18px;
        border-radius: var(--radius-lg);
    }

    .size-options {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .size-pill {
        flex: 1 1 calc(25% - 8px);
        min-width: 48px;
        text-align: center;
        box-sizing: border-box;
    }

    .color-picker-group {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .color-picker-wrapper {
        width: 100%;
    }

    .color-input-row {
        width: 100%;
    }

    .color-input-row .color-hex {
        min-width: 0;
        flex: 1;
    }

    .download-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .action-buttons .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .ec-options {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        width: 100%;
    }

    .ec-pill {
        width: 100%;
        justify-content: center;
    }

    .qr-preview-image {
        max-width: 100%;
    }

    .qr-preview-image img {
        max-width: 100%;
        height: auto;
        max-height: 280px;
        object-fit: contain;
    }

    .toast-container {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }

    .toast {
        min-width: unset;
        max-width: 100%;
    }
}

/* Small Mobile Screens (max-width: 576px) */
@media (max-width: 576px) {
    .glass-card {
        padding: 16px;
        border-radius: var(--radius-md);
    }

    .brand-text .brand-sub {
        display: none !important;
    }

    .accent-pill {
        width: 16px;
        height: 16px;
    }

    .accent-pills {
        gap: 4px;
    }

    .theme-toggle {
        width: 44px;
        height: 24px;
        padding: 1px;
    }

    .theme-toggle .toggle-thumb {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    [data-theme="dark"] .theme-toggle .toggle-thumb {
        transform: translateX(20px);
    }

    .size-pill {
        flex: 1 1 calc(33.33% - 8px);
        padding: 8px 10px;
        font-size: 0.82rem;
    }

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

    .logo-upload-area {
        padding: 18px 12px;
    }

    .logo-preview-wrapper {
        flex-wrap: wrap;
    }

    .btn-reset {
        padding: 12px;
        font-size: 0.85rem;
    }
}

/* Extra Small Screens (max-width: 360px) */
@media (max-width: 360px) {
    .brand-text {
        font-size: 0.88rem;
    }

    .size-pill {
        flex: 1 1 calc(50% - 8px);
    }
}

/* ------------------------------------------------------------------ */
/*  Utility                                                           */
/* ------------------------------------------------------------------ */
.mb-0 { margin-bottom: 0 !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.text-center { text-align: center; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Auto-upgraded notice */
.ec-auto-notice {
    display: none;
    font-size: 0.75rem;
    color: var(--brand-accent);
    margin-top: 6px;
    font-weight: 500;
}

.ec-auto-notice.visible {
    display: block;
}

/* Separator */
.separator {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}
