/* ==========================================================================
   main.css — токены, шрифты, базовые стили, layout, header, footer, кнопки
   ========================================================================== */

/* ---------- Fonts (Inter variable, локальные файлы) ---------- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../assets/fonts/inter-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../assets/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Design tokens ---------- */
:root {
    color-scheme: dark;

    --font-family: 'Inter', sans-serif;

    --color-body: #17171e;
    --color-text: #c9c9c9;
    --color-heading: #ebeef3;
    --color-muted: #bbbbbb;
    --color-gray: #848e9c;
    --color-gray-hover: #a9b0bb;
    --color-dimmed: #828282;
    --color-placeholder: #696969;
    --color-danger: #f04438;

    --color-primary: #576cd3;
    --color-primary-5: #485fcf;
    --color-primary-6: #3b54cd;
    --color-link-hover: #a6b1e7;

    --color-border: #2f2f35;
    --color-input-border: rgba(255, 255, 255, 0.05);
    --color-surface: rgba(42, 42, 54, 0.5);
    --color-surface-strong: rgba(42, 42, 54, 0.6);
    --color-modal: #24242a;
    --color-dropdown: #23232a;
    --color-disabled-bg: #2e2e2e;
    --color-disabled-text: #696969;

    --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-6) 100%);

    --radius-sm: 5px;
    --shadow-xl: 0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 36px 28px -7px, rgba(0, 0, 0, 0.04) 0 17px 17px -7px;

    --container-width: 1280px;
    --container-padding: 15px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    --grad-limit: 50vw;
    --grad-opacity: 0.06;

    margin: 0;
    font-family: var(--font-family);
    font-size: 18px;
    line-height: 1.2;
    color: var(--color-text);
    background-color: var(--color-body);
    background-image: linear-gradient(90deg,
            rgba(87, 108, 211, var(--grad-opacity)),
            rgba(87, 108, 211, var(--grad-opacity)) calc(50% - var(--grad-limit)),
            transparent 50%,
            rgba(87, 108, 211, var(--grad-opacity)) calc(50% + var(--grad-limit)),
            rgba(87, 108, 211, var(--grad-opacity)));
    background-position: 50% 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.is-scroll-locked {
    overflow: hidden;
}

img {
    max-width: 100%;
}

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

button {
    text-transform: none;
}

a {
    color: var(--color-primary);
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    text-decoration-line: none;
}

a:hover {
    color: var(--color-link-hover);
    text-decoration-line: underline;
}

dl,
dt,
dd {
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

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

/* ---------- Layout ---------- */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    background: radial-gradient(100% 100% at 50% -100px, rgba(87, 108, 211, 0.2), transparent 50%);
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--container-padding);
}

/* ---------- Typography helpers ---------- */
.section-title {
    margin: 0;
    font-size: 32px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-heading);
}

.section-title em,
.accent {
    font-style: normal;
    color: var(--color-primary);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- Surfaces ---------- */
.paper {
    position: relative;
    padding: 48px;
    border-radius: 24px;
    font-size: 16px;
    background: var(--color-surface);
}

/* ---------- Buttons ---------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 18px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background: var(--color-primary);
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover {
    color: #fff;
    text-decoration: none;
    background-color: var(--color-primary-5);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled='true'] {
    color: var(--color-disabled-text);
    background: var(--color-disabled-bg);
    border-color: transparent;
    cursor: not-allowed;
    transform: none;
}

.btn__icon {
    display: flex;
    flex-shrink: 0;
    margin-left: 10px;
}

.btn--outline {
    color: var(--color-primary);
    background: transparent;
    border-color: var(--color-primary);
}

.btn--outline:hover {
    color: var(--color-primary);
    background-color: rgba(87, 108, 211, 0.05);
}

.btn--gradient,
.btn--gradient:hover {
    background: var(--gradient-primary);
    border: 0;
}

/* Кнопки с «ripple»-подсветкой и подъёмом при наведении */
.btn--glow {
    box-shadow: 0 8px 24px rgba(87, 108, 211, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn--glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease;
    pointer-events: none;
}

.btn--glow:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 32px rgba(87, 108, 211, 0.4);
}

.btn--glow:hover::before {
    transform: translate(-50%, -50%) scale(2.5);
}

.btn--glow:active {
    transform: translateY(0) scale(0.98);
}

.btn--block {
    display: flex;
    width: 100%;
}

/* Крупная кнопка отправки форм (48px, uppercase) */
.btn--submit {
    width: 100%;
    height: 48px;
    font-size: 18px;
    text-transform: uppercase;
}

/* ---------- Header ---------- */
.header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    margin-bottom: 64px;
}

.header__left {
    display: flex;
    align-items: center;
    gap: 48px;
}

.header__nav {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.header__burger {
    display: none;
    flex-shrink: 0;
    width: 34px;
    height: 24px;
    margin-right: 10px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    transform: translateX(-5px);
}

.header__burger svg {
    display: block;
    width: 24px;
    height: 18px;
    margin: 3px auto;
}

.header__logo {
    display: block;
    flex-shrink: 0;
    width: auto;
    height: 38px;
}

.header__logo img {
    display: block;
    width: auto;
    height: 100%;
}

.nav {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 16px;
    line-height: 1.4;
}

.nav a {
    display: block;
    color: var(--color-gray);
    text-decoration: none;
}

.nav a:hover {
    color: var(--color-gray-hover);
    text-decoration: none;
}

.header__right {
    display: flex;
    gap: 24px;
}

.header__account {
    display: flex;
    gap: 12px;
}

.header__login {
    height: 40px;
    padding: 0 24px;
}

.header__icon-btn {
    height: 40px;
    min-width: 48px;
    padding: 0;
    border-width: 2px;
}

.header__theme-icon {
    display: block;
    width: 24px;
    height: 24px;
    margin: auto;
}

.header__lang-text {
    padding: 0 12px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
}

/* ---------- Mobile menu (drawer) ---------- */
.drawer {
    position: fixed;
    inset: 0;
    z-index: 200;
}

.drawer__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.drawer__panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* Высота меню как в оригинале (27.5rem). Увеличьте, если нужно видеть кнопку «Войти» без прокрутки */
    max-height: 440px;
    overflow-y: auto;
    border-radius: 0 0 12px 12px;
    background: var(--color-modal);
    box-shadow: var(--shadow-xl);
    transform: translateY(-100%);
    transition: transform 0.2s ease;
}

.drawer.is-open .drawer__overlay {
    opacity: 1;
}

.drawer.is-open .drawer__panel {
    transform: none;
}

.mobile-menu {
    position: relative;
    padding: 16px;
    background-color: var(--color-modal);
}

.mobile-menu__close {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='25' height='25' fill='none'%3E%3Cpath fill='%23BBB' d='M25 1.613 23.387 0 12.5 10.887 1.613 0 0 1.613 10.887 12.5 0 23.387 1.613 25 12.5 14.113 23.387 25 25 23.387 14.113 12.5 25 1.613Z'/%3E%3C/svg%3E") no-repeat left bottom;
    cursor: pointer;
}

.mobile-menu__title {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 20px;
    font-weight: 500;
    color: var(--color-heading);
}

.mobile-menu__list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-menu__list li {
    border-bottom: 1px solid var(--color-border);
}

.mobile-menu__list a {
    display: block;
    padding: 16px 12px;
    font-size: 16px;
    color: var(--color-muted);
    text-decoration: none;
}

.mobile-menu__actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.mobile-menu__account {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mobile-menu__theme {
    gap: 6px;
}

.mobile-menu__theme img {
    display: block;
    width: 24px;
    height: 24px;
}

/* ---------- Footer ---------- */
.footer {
    margin-top: auto;
    overflow: hidden;
}

.footer__inner {
    margin-top: 64px;
    padding: 48px 0;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    line-height: 1.4;
    color: var(--color-muted);
}

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

.footer__col {
    min-width: 0;
}

.footer__logo {
    display: block;
    width: auto;
    height: 40px;
}

.footer__logo img {
    display: block;
    width: auto;
    height: 100%;
}

.footer__slogan {
    width: 180px;
    max-width: 100%;
    margin: 16px 0 0;
    font-size: 16px;
    line-height: 1.4;
}

.footer__title {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-heading);
}

.footer__menu {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer__menu a {
    display: block;
    color: var(--color-muted);
    text-decoration: none;
}

.footer__menu a:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

/* ---------- Animations ---------- */
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-left {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fade-in-right {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }
}
