@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root {
    color-scheme: light;
    --bg-0: #f3f5f7;
    --panel: rgba(255, 255, 255, 0.86);
    --surface-soft: #f7f9fb;
    --line: rgba(16, 21, 28, 0.075);
    --ink: #10151c;
    --ink-btn: #171c23;
    --muted: #556171;
    --muted-2: #5f6978;
    --accent: #19549b;
    --accent-strong: #113f75;
    --shadow: 0 18px 54px rgba(31, 38, 135, 0.06);
    --radius-lg: 24px;
    --radius-md: 19px;
    --radius-sm: 11px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    color: var(--ink);
    font-family: Inter, "Segoe UI", Roboto, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background:
        radial-gradient(circle at 18% 8%, rgba(25, 84, 155, 0.08), transparent 30vw),
        radial-gradient(circle at 82% 18%, rgba(140, 198, 63, 0.055), transparent 28vw),
        linear-gradient(135deg, #f6f8fa 0%, #eef3f7 48%, #f7f9fb 100%);
}

/* ===== Макет Окна ===== */
.app-main-wrapper {
    min-height: 100vh;
    padding: 8px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}
@media (min-width: 1024px) {
    .app-main-wrapper {
        padding: 16px;
    }
}

.app-window {
    width: 100%;
    max-width: 1200px;
    background: #fff;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== Шапка-бар ===== */
.app-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 28px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.company-logo {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    background: var(--accent);
    mask: url("assets/logo.png") no-repeat center / contain;
    -webkit-mask: url("assets/logo.png") no-repeat center / contain;
}

.header-brand h1 {
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.045em;
}

.header-brand p {
    color: var(--muted-2);
    font-size: 0.68rem;
    line-height: 1.35;
    letter-spacing: 0.02em;
}

.window-controls {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.window-controls span {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}
.window-controls span:nth-child(1) { background: #98a4b0; }
.window-controls span:nth-child(2) { background: #ccd3da; }
.window-controls span:nth-child(3) { background: #19549b; }

@media (max-width: 900px) {
    .app-header {
        padding: 14px;
        gap: 16px;
    }
}

.container { width: 100%; margin: 0 auto; padding: 1.5rem 1.5rem 2rem; }

/* ===== Панели ===== */
.glass-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}

.section-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 1.2rem;
}

/* ===== Сетка ===== */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
@media (max-width: 860px) { .main-grid { grid-template-columns: 1fr; } }

/* ===== Форма ===== */
.field { margin-bottom: 0.85rem; }
.field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.field input {
    width: 100%;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.72rem 0.95rem;
    color: var(--ink);
    font-size: 0.92rem;
    font-family: inherit;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.field input:focus {
    background: #fff;
    border-color: rgba(25, 84, 155, 0.34);
    box-shadow: 0 0 0 4px rgba(25, 84, 155, 0.08);
}
.field input::placeholder { color: #a9b2bd; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

/* ===== Баннер-переключатель ===== */
.banner-toggle {
    border-top: 1px solid var(--line);
    padding-top: 0.9rem;
    margin-top: 0.4rem;
}
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    margin-bottom: 0.5rem;
    user-select: none;
}
.toggle-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 38px;
    height: 20px;
    background: rgba(16, 21, 28, 0.08);
    border-radius: 999px;
    position: relative;
    outline: none;
    cursor: pointer;
    transition: background-color 200ms ease;
}
.toggle-label input[type="checkbox"]:checked {
    background: var(--accent);
}
.toggle-label input[type="checkbox"]::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-label input[type="checkbox"]:checked::before {
    transform: translateX(18px);
}
.banner-opts { padding-left: 0.5rem; margin-top: 0.8rem; }
.hidden { display: none !important; }

/* ===== Кнопки ===== */
.btn-generate,
.btn-primary-copy {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 44px;
    background: var(--ink-btn);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 160ms cubic-bezier(0.16, 1, 0.3, 1), transform 160ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 160ms cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 0.015em;
    box-shadow: 0 4px 12px rgba(16, 21, 28, 0.08);
}
.btn-generate { margin-top: 0.7rem; }
.btn-generate:hover,
.btn-primary-copy:hover {
    background: var(--ink);
    transform: translateY(-1.5px);
    box-shadow: 0 8px 20px rgba(16, 21, 28, 0.14);
}
.btn-generate:active,
.btn-primary-copy:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(16, 21, 28, 0.08);
}

.copy-hint {
    font-size: 0.76rem;
    color: var(--muted);
    text-align: center;
    margin: 0.7rem 0 1.3rem;
    line-height: 1.55;
}

/* ===== Предупреждение о картинках ===== */
.img-warning {
    background: rgba(214, 48, 49, 0.05);
    border: 1px solid rgba(214, 48, 49, 0.18);
    color: #a83a3a;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.1rem;
    font-size: 0.8rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}
.img-warning code {
    background: rgba(214, 48, 49, 0.08);
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
    font-size: 0.74rem;
    font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
}

/* ===== Предпросмотр ===== */
.preview-box {
    background: #fff;
    border: 1px solid rgba(16, 21, 28, 0.08);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    min-height: 260px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 10px 30px rgba(17, 17, 17, 0.04);
}
.placeholder-text {
    color: #a9b2bd;
    text-align: center;
    padding: 4rem 0;
    font-size: 0.85rem;
}

/* ===== Секция результата ===== */
.code-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid rgba(16, 21, 28, 0.055);
    border-radius: 999px;
    background: rgba(247, 249, 251, 0.78);
}
.tab {
    height: 30px;
    padding: 0 0.9rem;
    border: none;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    background: transparent;
    color: var(--muted);
    transition: background-color 140ms ease, color 140ms ease;
}
.tab:hover { color: var(--ink); }
.tab.active {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 2px 8px rgba(16, 21, 28, 0.07);
}

.btn-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.btn-copy, .btn-dl {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 0.85rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 140ms ease;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
}
.btn-copy:hover, .btn-dl:hover {
    border-color: rgba(25, 84, 155, 0.15);
    background: var(--surface-soft);
    color: var(--ink);
    transform: translateY(-1px);
}

.code-block {
    background: var(--surface-soft);
    border-radius: var(--radius-sm);
    padding: 1rem;
    overflow: auto;
    max-height: 320px;
    font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
    font-size: 0.7rem;
    line-height: 1.55;
    color: #195f72;
    border: 1px solid var(--line);
}

/* ===== Инструкции по установке ===== */
.install-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
.install-item {
    background: var(--surface-soft);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    transition: border-color 140ms ease;
}
.install-item:hover { border-color: rgba(25, 84, 155, 0.15); }
.install-item h3 {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.install-item ol {
    padding-left: 1.1rem;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.65;
}
.install-note {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed rgba(16, 21, 28, 0.1);
    font-size: 0.72rem;
    line-height: 1.55;
    color: var(--muted);
}
.install-item code {
    background: rgba(25, 84, 155, 0.07);
    padding: 0.1rem 0.3rem;
    border-radius: 6px;
    font-size: 0.72rem;
    color: var(--accent);
    font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
}

/* ===== Скроллбар ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(25, 84, 155, 0.18); border-radius: 999px; }

.tab-content { }
