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

:root {
    --green: #2563eb;
    --green-dark: #1d4ed8;

    --ink: #263238;
    --muted: #788187;
    --line: #e8ecee;
    --soft: #f7f9fc;

    --page-bg: #ffffff;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --text-main: #263238;
    --text-muted: #899196;

    --transition: .25s ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text-main);
    font-family: Inter, Arial, sans-serif;
    transition:
        background var(--transition),
        color var(--transition);
}

button,
input {
    font-family: inherit;
}

/* ==============================
   PAGE
============================== */

.page {
    max-width: 1300px;
    margin: auto;
    padding: 0 32px;
}

/* ==============================
   HEADER
============================== */

.top {
    height: 90px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
    gap: 42px;
    transition: border-color var(--transition);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 800;
    font-size: 23px;
    letter-spacing: -.8px;
    transition: color var(--transition);
}

.brand-mark {
    width: 42px;
    height: 42px;
    background: var(--green);
    color: white;
    display: grid;
    place-items: center;
    border-radius: 11px;
    font-size: 23px;
}

.top nav {
    display: flex;
    gap: 34px;
    margin-left: auto;
}

.top nav a {
    font-size: 15px;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s;
}

.top nav a:hover {
    color: var(--green);
}

.top-note {
    font-size: 13px;
    color: #9aa2a6;
    border-left: 1px solid var(--line);
    padding-left: 28px;
}

/* ==============================
   THEME BUTTON
============================== */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 15px;

    border: 1px solid #e2e8f0;
    border-radius: 8px;

    background: #ffffff;
    color: #475569;

    font: 600 13px Inter, sans-serif;

    cursor: pointer;
    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        transform .2s;
}

.theme-toggle:hover {
    background: #eff6ff;
    border-color: #93b4f5;
    color: var(--green);
    transform: translateY(-1px);
}

.theme-toggle:active {
    transform: scale(.97);
}

.theme-toggle span:first-child {
    font-size: 19px;
    line-height: 1;
}

/* ==============================
   ACTIONS WRAPPER (Кнопки под шапкой)
============================== */

.actions-wrapper {
    display: flex;
    justify-content: flex-end; /* На ПК прижимаем вправо */
    margin-top: 20px; /* Опускаем чуть ниже шапки */
    padding: 0 32px; /* Отступы по бокам как у основного контента */
    width: 100%;
    box-sizing: border-box;
}

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

/* ==============================
   MAIN
============================== */

main {
    max-width: 920px;
    margin: auto;
}

/* ==============================
   HERO
============================== */

.hero {
    text-align: center;
    padding: 85px 0 42px;
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: 700;
    color: #6b93e8;
}

.eyebrow span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    vertical-align: 2px;
    margin-right: 8px;
}

.hero h1 {
    font-size: 54px;
    line-height: 1.15;
    letter-spacing: -2.4px;
    margin: 20px 0 16px;
    font-weight: 700;
    color: #303a3f;
}

.hero h1 em {
    font-style: normal;
    color: var(--green);
}

.lead {
    font-size: 16px;
    line-height: 1.85;
    color: var(--text-muted);
    margin: 0 0 36px;
}

/* ==============================
   DOWNLOAD CARD
============================== */

.download-card {
    max-width: 850px;
    margin: auto;
    text-align: left;
    padding: 27px 28px 23px;

    border: 1px solid #e6ebea;
    border-radius: 9px;

    box-shadow: 0 12px 35px #1e3b2a0b;
    background: var(--card-bg);

    transition:
        background var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

/* ==============================
   PLATFORM TABS
============================== */

.platform-tabs {
    display: flex;
    gap: 9px;
    margin-bottom: 23px;
}

.platform-tab {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #7b8580;

    border-radius: 6px;
    padding: 12px 20px;

    font: 600 13px Inter;
    cursor: pointer;

    transition: .2s;
}

.platform-tab:hover {
    border-color: #93b4f5;
    color: var(--green-dark);
}

.platform-tab.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--green-dark);
}

/* ==============================
   VIDEO TABS
============================== */

.tabs {
    display: flex;
    gap: 9px;
    border-bottom: 1px solid var(--line);
    margin: -2px 0 24px;
}

.tab {
    background: transparent;
    color: #7d878b;

    border: 0;
    border-bottom: 2px solid transparent;

    padding: 0 17px 15px;

    font: 600 14px Inter;
    cursor: pointer;

    transition: color .2s;
}

.tab.active {
    color: var(--green);
    border-color: var(--green);
}

.tab[hidden],
.select-all[hidden] {
    display: none !important;
}

/* ==============================
   INPUT
============================== */

.download-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 11px;
    color: #59656a;
}

.input-line {
    display: flex;
    border: 4px solid var(--green);
    height: 64px;
    background: var(--input-bg);
}

.input-line input {
    flex: 1;
    min-width: 0;

    border: 0;
    outline: 0;

    padding: 0 18px;

    font: 15px Inter;
    color: var(--text-main);
    background: transparent;
}

.input-line input::placeholder {
    color: #9ba3a7;
}

.input-line button {
    width: 155px;
    border: 0;

    background: var(--green);
    color: white;

    font: 700 15px Inter;
    cursor: pointer;

    transition: background .2s;
}

.input-line button:hover {
    background: var(--green-dark);
}

.input-line button span {
    font-size: 21px;
    margin-left: 8px;
}

.input-line button:disabled {
    opacity: .55;
    cursor: wait;
}

.under-input {
    font-size: 12px;
    color: #a0a8ab;
    margin-top: 13px;
}

.lock {
    color: var(--green);
    font-size: 10px;
    margin-right: 6px;
}

/* ==============================
   STATUS
============================== */

.status {
    min-height: 18px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--green);
}

.status.error {
    color: #d34e4e;
}

/* ==============================
   FORMATS
============================== */

.formats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;

    margin-top: 24px;
    font-size: 13px;
    color: #a0a8ab;
}

.formats b {
    font-size: 12px;
    color: #77837c;

    border: 1px solid #e7ece8;
    border-radius: 5px;

    padding: 7px 11px;
}

.formats i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #c3c9c6;
}

/* ==============================
   RESULTS
============================== */

.results {
    margin: 38px 0 65px;
}

.hidden {
    display: none !important;
}

.results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 17px;
}

.results-head h2 {
    font-size: 24px;
    margin: 8px 0 5px;
    letter-spacing: -.5px;
}

.results-head p {
    margin: 0;
    color: #98a1a4;
    font-size: 13px;
}

.select-all {
    border: 1px solid #e1e8f2;
    background: white;
    color: var(--green);

    border-radius: 6px;
    padding: 11px 15px;

    font: 600 13px Inter;
    cursor: pointer;

    transition: .2s;
}

.select-all:hover {
    background: #eff6ff;
}

/* ==============================
   VIDEO LIST
============================== */

.video-list {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: auto;
    max-height: 450px;
}

.video-row {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 13px 16px;

    border-bottom: 1px solid #eef0ef;
    cursor: pointer;

    transition: background .2s;
}

.video-row:last-child {
    border: 0;
}

.video-row:hover {
    background: #f8faff;
}

.video-check {
    accent-color: var(--green);
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.video-row img {
    width: 95px;
    height: 54px;
    object-fit: cover;

    border-radius: 4px;
    background: #eef2f8;
    flex-shrink: 0;
}

.video-name {
    flex: 1;
    min-width: 0;

    font-size: 13px;
    line-height: 1.5;
    color: #3d484d;
}

.video-author {
    display: block;
    color: #9aa3a5;
    font-size: 11px;
    margin-top: 4px;
}

.video-duration {
    font-size: 12px;
    color: #929b9e;
    flex-shrink: 0;
}

/* ==============================
   DOWNLOAD ACTIONS
============================== */

.download-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 19px;
    margin-top: 14px;

    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;

    transition:
        background var(--transition),
        border-color var(--transition);
}

.selection b,
.selection small {
    display: block;
}

.selection b {
    font-size: 14px;
}

.selection small {
    font-size: 12px;
    color: #9aa3a5;
    margin-top: 6px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.format-button {
    border: 0;
    border-radius: 5px;
    padding: 14px 19px;

    font: 600 13px Inter;
    cursor: pointer;

    transition: .2s;
}

.format-button:hover {
    transform: translateY(-1px);
}

.format-button span {
    font-size: 16px;
    margin-right: 6px;
}

.format-button.mp4 {
    background: var(--green);
    color: #fff;
}

.format-button.mp4:hover {
    background: var(--green-dark);
}

.format-button.mp3 {
    background: #eff6ff;
    color: var(--green-dark);
    border: 1px solid #bfdbfe;
}

.format-button.mp3:hover {
    background: #dbeafe;
}

.format-button:disabled {
    opacity: .5;
    cursor: wait;
    transform: none;
}

/* ==============================
   HOW IT WORKS
============================== */

.how {
    padding: 32px 0 75px;
    border-top: 1px solid var(--line);
}

.how-title {
    text-align: center;
}

.how h2 {
    font-size: 29px;
    letter-spacing: -.9px;
    margin: 11px 0 30px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 17px;
}

.steps article {
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 21px;

    transition:
        background var(--transition),
        border-color var(--transition);
}

.steps article > span {
    display: block;
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
}

.steps b {
    font-size: 14px;
}

.steps p {
    font-size: 13px;
    line-height: 1.7;
    color: #90999d;
    margin: 9px 0 0;
}

/* ==============================
   FOOTER
============================== */

footer {
    border-top: 1px solid var(--line);
    padding: 25px 0 32px;

    display: flex;
    align-items: center;
    gap: 25px;

    transition: border-color var(--transition);
}

.brand.small {
    font-size: 17px;
}

.brand.small .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 17px;
}

footer p {
    font-size: 12px;
    line-height: 1.7;
    color: #a0a8ab;
    margin: 0;
}

/* ==============================
   DARK THEME
============================== */

body.dark-theme {
    --page-bg: #101827;
    --card-bg: #172337;
    --input-bg: #101827;

    --text-main: #e2e8f0;
    --text-muted: #94a3b8;

    --line: #263449;
    --soft: #172337;

    background: #101827;
    color: #e2e8f0;
}

body.dark-theme .top {
    border-color: #263449;
}

body.dark-theme .brand {
    color: #f1f5f9;
}

body.dark-theme .top nav a {
    color: #aab7ca;
}

body.dark-theme .top nav a:hover {
    color: #60a5fa;
}

body.dark-theme .top-note {
    color: #8493a8;
    border-color: #263449;
}

body.dark-theme .hero h1 {
    color: #e2e8f0;
}

body.dark-theme .eyebrow {
    color: #93b4f5;
}

body.dark-theme .download-card {
    background: #172337;
    border-color: #293950;
    box-shadow: 0 12px 35px #00000020;
}

body.dark-theme .platform-tab {
    background: #1e2d43;
    border-color: #34445c;
    color: #b8c5d8;
}

body.dark-theme .platform-tab.active {
    background: #1e3a68;
    border-color: #2563eb;
    color: #93c5fd;
}

body.dark-theme .tab {
    color: #aab7ca;
}

body.dark-theme .tab.active {
    color: #60a5fa;
}

body.dark-theme .tabs {
    border-color: #263449;
}

body.dark-theme .download-card label {
    color: #cbd5e1;
}

body.dark-theme .input-line {
    background: #101827;
}

body.dark-theme .input-line input {
    background: #101827;
    color: #e2e8f0;
}

body.dark-theme .input-line input::placeholder {
    color: #718096;
}

body.dark-theme .under-input,
body.dark-theme .formats,
body.dark-theme .results-head p,
body.dark-theme .selection small,
body.dark-theme .video-author,
body.dark-theme .video-duration {
    color: #8493a8;
}

body.dark-theme .formats b {
    color: #cbd5e1;
    border-color: #34445c;
}

body.dark-theme .formats i {
    background: #52647e;
}

body.dark-theme .select-all {
    background: #1e2d43;
    border-color: #34445c;
    color: #60a5fa;
}

body.dark-theme .select-all:hover {
    background: #263b5a;
}

body.dark-theme .video-list {
    border-color: #293950;
}

body.dark-theme .video-row {
    border-color: #293950;
}

body.dark-theme .video-row:hover {
    background: #1e2d43;
}

body.dark-theme .video-name {
    color: #e2e8f0;
}

body.dark-theme .video-row img {
    background: #263449;
}

body.dark-theme .download-actions {
    background: #172337;
    border-color: #293950;
}

body.dark-theme .format-button.mp3 {
    background: #1e3a68;
    color: #93c5fd;
    border-color: #31558b;
}

body.dark-theme .format-button.mp3:hover {
    background: #274b7e;
}

body.dark-theme .steps article {
    border-color: #293950;
    background: #172337;
}

body.dark-theme .steps b {
    color: #e2e8f0;
}

body.dark-theme .steps p {
    color: #94a3b8;
}

body.dark-theme .how {
    border-color: #263449;
}

body.dark-theme footer {
    border-color: #263449;
}

body.dark-theme footer p {
    color: #8493a8;
}

body.dark-theme .theme-toggle {
    background: #1e2d43;
    border-color: #34445c;
    color: #e2e8f0;
}

body.dark-theme .theme-toggle:hover {
    background: #263b5a;
    border-color: #3b82f6;
    color: #93c5fd;
}

/* ==============================
   RESPONSIVE
============================== */

@media (max-width: 800px) {
    .page {
        padding: 0 20px;
    }

    .top {
        height: 76px;
        gap: 20px;
    }

    .top nav {
        gap: 18px;
    }

    .top nav a {
        font-size: 13px;
    }

    .top-note {
        font-size: 11px;
        padding-left: 15px;
    }

    main {
        max-width: 100%;
    }

    .hero {
        padding: 65px 0 35px;
    }

    .hero h1 {
        font-size: 46px;
    }

    .download-card {
        max-width: 100%;
        padding: 23px;
    }
    
    .actions-wrapper {
        padding: 0 20px;
        margin-top: 15px;
    }
}

@media (max-width: 650px) {
    .page {
        padding: 0 16px;
    }

    .top {
        height: 68px;
    }

    .brand {
        font-size: 19px;
    }

    .brand-mark {
        width: 36px;
        height: 36px;
        font-size: 19px;
    }

    .top nav {
        display: none;
    }

    .top-note {
        margin-left: auto;
        font-size: 10px;
    }

    .theme-toggle {
        padding: 9px 12px;
        font-size: 12px;
    }

    .hero {
        padding: 53px 0 27px;
    }

    .eyebrow {
        font-size: 10px;
    }

    .hero h1 {
        font-size: 38px;
        letter-spacing: -1.5px;
    }

    .lead {
        font-size: 14px;
    }

    .download-card {
        padding: 17px;
    }

    .platform-tab {
        padding: 10px 15px;
        font-size: 12px;
    }

    .tab {
        font-size: 12px;
        padding: 0 12px 12px;
    }

    .input-line {
        height: auto;
        min-height: 54px;
    }

    .input-line input {
        padding: 0 10px;
        font-size: 12px;
    }

    .input-line button {
        width: 105px;
        font-size: 12px;
    }

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

    .how h2 {
        font-size: 25px;
    }

    .download-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .action-buttons {
        width: 100%;
    }

    .format-button {
        flex: 1;
        padding: 12px 8px;
    }

    .video-row {
        gap: 8px;
    }

    .video-row img {
        width: 62px;
        height: 36px;
    }

    .video-name {
        font-size: 11px;
    }

    footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
    
    /* Адаптация кнопок на телефоне */
    .actions-wrapper {
        justify-content: center;
        padding: 0 16px;
        margin-top: 15px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .header-actions .theme-toggle {
        flex: 1;
        justify-content: center;
    }
}