:root {
    --bg: #1d252c;
    --bg-soft: #232d35;
    --bg-panel: #202930;
    --bg-input: #161d23;
    --line: #37414b;
    --line-soft: rgba(255, 255, 255, .08);
    --text: #d8e0e7;
    --text-strong: #f5f7f9;
    --muted: #9faebb;
    --accent: #e8cf93;
    --blue: #2f87f7;
    --green: #42d66f;
    --red: #d94b4b;
    --shadow: 0 18px 44px rgba(0, 0, 0, .24);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(70, 88, 103, .34), transparent 28%),
        linear-gradient(180deg, #20282f 0%, #1c2329 100%);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    background: #2a343d;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

button:focus-visible,
.button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.primary {
    color: #fff;
    background: var(--blue);
}

.primary:hover,
button.primary:hover {
    border-color: #74a8ff;
    background: #4c96ff;
    box-shadow: 0 12px 28px rgba(47, 135, 247, .26);
}

.ghost {
    color: var(--accent);
    border-color: rgba(232, 207, 147, .3);
    background: transparent;
}

.ghost:hover,
button.ghost:hover {
    color: #ffe6a7;
    border-color: rgba(232, 207, 147, .62);
    background: rgba(232, 207, 147, .08);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 22px;
    background: rgba(29, 37, 44, .96);
    border-bottom: 1px solid var(--line-soft);
    box-shadow: var(--shadow);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--text-strong);
    border-radius: 8px;
    padding: 4px 6px;
    margin: -4px -6px;
    transition: color .16s ease, background-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.brand:hover,
.brand:focus-visible {
    color: var(--gold);
    transform: translateY(-1px);
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 10px;
    border-color: var(--line-soft);
    background: rgba(22, 29, 35, .72);
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--text-strong);
}

a:hover {
    color: var(--text-strong);
}

a,
.nav-pill,
.nav-account-button {
    transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}

.nav-account {
    position: relative;
}

.nav-account-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: auto;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-weight: inherit;
}

.nav-account-button:hover,
.nav-account-button:focus-visible,
.nav-account.is-open .nav-account-button {
    color: var(--text-strong);
}

.nav-account-icon,
.nav-account-chevron,
.nav-account-menu-icon {
    display: block;
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex: 0 0 auto;
}

.nav-account-chevron {
    width: 16px;
    height: 16px;
    transition: transform .16s ease;
}

.nav-account.is-open .nav-account-chevron {
    transform: rotate(180deg);
}

.nav-account-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 30;
    display: none;
    width: 280px;
    padding: 8px 0;
    border: 1px solid var(--line-soft);
    border-radius: 0;
    background: var(--bg-panel);
    box-shadow: var(--shadow);
}

.nav-account.is-open .nav-account-menu {
    display: block;
}

.nav-account-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 0;
    color: var(--muted);
}

.nav-account-menu a:hover,
.nav-account-menu a:focus-visible {
    color: var(--text-strong);
    background: rgba(255, 255, 255, .06);
}

.nav-pill {
    padding: 8px 10px;
    color: var(--accent);
    border: 1px solid rgba(232, 207, 147, .32);
    border-radius: 8px;
}

.nav-form {
    margin: 0;
}

.nav-button {
    min-height: 34px;
    padding: 7px 10px;
    color: var(--muted);
    background: transparent;
    border-color: var(--line-soft);
}

.nav-button:hover {
    color: var(--text-strong);
    border-color: rgba(232, 207, 147, .35);
}

.flash {
    width: min(1040px, calc(100% - 36px));
    margin: 22px auto 0;
    padding: 14px 16px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: rgba(32, 41, 48, .92);
}

.flash-error {
    color: #ffb3b3;
    border-color: rgba(217, 75, 75, .5);
}

.flash-success {
    color: #b6f0c8;
    border-color: rgba(66, 214, 111, .45);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    gap: 34px;
    align-items: center;
    width: min(1180px, calc(100% - 36px));
    min-height: calc(100vh - 160px);
    margin: 0 auto;
    padding: 58px 0 42px;
}

.hero h1 {
    margin: 0 0 18px;
    color: var(--blue);
    font-size: clamp(2.35rem, 5vw, 4rem);
    line-height: 1.02;
}

.page-section h1 {
    margin: 0 0 16px;
    max-width: 980px;
    color: var(--blue);
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.08;
}

.hero p,
.page-section p {
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    font-size: .78rem;
}

.section-kicker {
    display: inline-flex;
    margin: 0 0 14px;
    color: var(--accent);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.section-lead {
    max-width: 900px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.connection-preview,
.feature-grid,
.content-grid,
.manager-grid,
.faq-list {
    display: grid;
    gap: 16px;
}

.connection-card,
.feature-grid article,
.page-section,
.auth-card,
.remote-panel,
.connection-list {
    background: rgba(32, 41, 48, .88);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.connection-card {
    padding: 22px;
    border-left: 4px solid var(--line);
    cursor: default;
}

.connection-card span {
    display: inline-flex;
    margin-bottom: 14px;
    color: var(--accent);
    font-weight: 800;
    font-size: .8rem;
}

.connection-card h2 {
    margin: 0 0 8px;
    color: var(--text-strong);
}

.connection-card p {
    margin: 0;
    color: var(--muted);
}

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

.color-blue {
    border-left-color: var(--blue);
}

.color-red {
    border-left-color: var(--red);
}

.feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto 58px;
}

.page-section .feature-grid,
.page-section .content-grid {
    width: 100%;
    margin: 26px 0 0;
}

.content-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-grid article,
.content-grid article {
    position: relative;
    padding: 24px;
}

.feature-grid article::before,
.content-grid article::before {
    content: "";
    display: block;
    width: 36px;
    height: 3px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--blue));
}

.content-grid article {
    background: rgba(22, 29, 35, .42);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
}

.content-grid h2 {
    margin: 0 0 10px;
    color: var(--green);
    font-size: 1.08rem;
}

.feature-grid h2,
.faq-list h2 {
    margin: 0 0 10px;
    color: var(--green);
    font-size: 1.12rem;
}

.section-subtitle {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 1.35rem;
}

.page-section {
    position: relative;
    width: min(1040px, calc(100% - 36px));
    margin: 42px auto;
    padding: 34px;
}

.not-found-section {
    min-height: min(680px, calc(100dvh));
    text-align: center;
    overflow: hidden;
    background: url("/images/ftp-manager-404-background.webp") center / cover no-repeat;
    background-size: auto 100%;
}

.content-section::before {
    content: "";
    display: block;
    width: 68px;
    height: 4px;
    margin-bottom: 24px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--green));
}

.check-list {
    display: grid;
    gap: 12px;
    padding-left: 20px;
    color: var(--text);
}

.faq-list article,
.faq-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--line-soft);
}

.faq-accordion {
    display: grid;
    gap: 10px;
}

.faq-item {
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: rgba(22, 29, 35, .55);
}

.faq-item h3 {
    margin: 0;
}

.faq-item button {
    width: 100%;
    justify-content: space-between;
    min-height: 58px;
    border: 0;
    border-radius: 0;
    padding: 16px 18px;
    background: transparent;
    color: var(--text-strong);
    text-align: left;
    font-size: 1.02rem;
    font-weight: 750;
}

.faq-item button[aria-expanded="true"] {
    color: var(--accent);
}

.faq-answer {
    padding: 0 18px 18px;
}

.legal-text h2 {
    margin: 28px 0 10px;
    color: var(--text-strong);
}

.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px;
    color: var(--muted);
    border-top: 1px solid var(--line-soft);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.footer-powered {
    color: color-mix(in srgb, var(--muted) 82%, transparent);
    font-size: .92rem;
}

.footer-powered a {
    color: var(--text);
    font-weight: 750;
    text-decoration: none;
}

.footer-powered a:hover {
    color: var(--accent);
}

@media (max-width: 820px) {
    body {
        background: #1d252c;
    }

    body.menu-open {
        overflow: hidden;
    }

    .topbar {
        position: sticky;
        z-index: 1002;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        box-shadow: none;
    }

    body.menu-open .topbar {
        background: transparent;
        border-bottom-color: transparent;
    }

    .footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .brand {
        max-width: 100%;
        font-size: 1rem;
    }

    .menu-toggle {
        position: relative;
        z-index: 1003;
        display: inline-block;
        margin-left: auto;
        border: 0;
        background: transparent;
    }

    .menu-toggle span {
        position: absolute;
        left: 11px;
        width: 22px;
        transition: transform .22s ease, opacity .22s ease, top .22s ease;
    }

    .menu-toggle span:nth-child(1) { top: 14px; }
    .menu-toggle span:nth-child(2) { top: 21px; }
    .menu-toggle span:nth-child(3) { top: 28px; }

    .menu-toggle[aria-expanded="true"] span:nth-child(1) {
        top: 21px;
        transform: rotate(45deg);
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(3) {
        top: 21px;
        transform: rotate(-45deg);
    }

    .brand-mark {
        width: 30px;
        height: 30px;
    }

    .brand-mark img {
        width: 30px;
        height: 30px;
    }

    .main-nav {
        position: fixed;
        inset: 0;
        z-index: 1001;
        width: 100%;
        height: 100dvh;
        display: none;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 28px;
        padding: 120px 28px 80px;
        color: var(--text-strong);
        background: #080d18;
    }

    .main-nav.is-open {
        display: flex;
        animation: menuFadeIn .2s ease both;
    }

    .main-nav a,
    .main-nav .nav-account,
    .main-nav .nav-form {
        width: auto;
    }

    .main-nav a,
    .nav-button,
    .nav-account-button {
        width: auto;
        min-height: auto;
        justify-content: center;
        padding: 0;
        color: var(--text-strong);
        background: transparent;
        border: 0;
        border-radius: 0;
        font-size: 1rem;
        font-weight: 800;
        letter-spacing: .08em;
        text-transform: uppercase;
    }

    .nav-account {
        display: grid;
        justify-items: center;
        gap: 14px;
    }

    .nav-account-button {
        gap: 9px;
    }

    .nav-account-icon,
    .nav-account-chevron {
        width: 19px;
        height: 19px;
    }

    .nav-account-menu {
        position: static;
        display: none;
        width: auto;
        min-width: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .nav-account.is-open .nav-account-menu {
        display: grid;
        gap: 12px;
    }

    .nav-account-menu a {
        justify-content: center;
        gap: 8px;
        padding: 0;
        color: var(--muted);
        font-size: .9rem;
        font-weight: 800;
        letter-spacing: .08em;
        text-transform: uppercase;
        background: transparent;
    }

    .nav-account-menu-icon {
        width: 16px;
        height: 16px;
    }

    .nav-pill {
        color: var(--accent);
        border: 1px solid rgba(232, 207, 147, .36);
        border-radius: 8px;
        padding: 10px 14px;
    }

    .hero,
    .feature-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        width: min(100% - 24px, 520px);
        min-height: auto;
        padding: 24px 0 28px;
        gap: 18px;
    }

    .page-section {
        width: min(100% - 24px, 620px);
        margin: 18px auto 28px;
        padding: 22px;
    }

    .feature-grid,
    .content-grid {
        width: min(100% - 24px, 620px);
        margin-bottom: 28px;
    }

    .feature-grid article,
    .content-grid article {
        padding: 20px;
    }

    .page-section .feature-grid,
    .page-section .content-grid {
        width: 100%;
        margin-bottom: 0;
    }

    .hero h1,
    .page-section h1 {
        font-size: 2rem;
        line-height: 1.08;
    }

    .hero p,
    .page-section p {
        font-size: 1rem;
        line-height: 1.58;
    }

    .footer {
        gap: 10px;
        padding: 20px 16px;
    }
    .not-found-section {
        min-height: calc(45dvh);
    }
}

@media (max-width: 820px) and (orientation: portrait) {
    .footer {
        align-items: center;
        gap: 12px;
    }

    .footer-links {
        align-items: center;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .footer-links a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: min(100%, 280px);
        min-height: 42px;
        padding: 10px 14px;
        border: 1px solid var(--line-soft);
        border-radius: 8px;
        background: rgba(22, 29, 35, .55);
        color: var(--text);
        transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
    }

    .footer-links a:hover {
        border-color: rgba(232, 207, 147, .45);
        background: #34414b;
        color: var(--text-strong);
        transform: translateY(-1px);
    }

    .footer-powered a {
        display: inline;
        width: auto;
        min-height: 0;
        padding: 0;
        border: 0;
        background: transparent;
    }
}

@media (max-width: 430px) {
    .main-nav {
        gap: 24px;
    }

    .hero h1,
    .page-section h1 {
        font-size: 1.8rem;
    }
}

@keyframes menuFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
