﻿/* =============================================
   WIFA — основной CSS. Светлая / тёмная тема.
   ============================================= */

/* ---------- CSS-переменные: светлая тема ---------- */
:root {
    --bg:           #f0ede8;
    --bg-sidebar:   #ffffff;
    --bg-header:    #ffffff;
    --bg-card:      #ffffff;
    --bg-input:     #f7f5f2;
    --border:       #e0dbd4;
    --text:         #1a1a1a;
    --text-muted:   #6b6b6b;
    --text-label:   #444444;
    --accent:       #2a6620;
    --accent-hover: #235518;
    --accent-text:  #ffffff;
    --btn-outline-border: #c0bbb5;
    --btn-outline-text:   #333333;
    --btn-outline-hover:  #f0ede8;
    --link:         #2a6620;
    --shadow:       0 1px 4px rgba(0,0,0,.08);
    --radius:       10px;
    --header-h:     58px;
    --sidebar-w:    220px;
    --font:         'Inter', system-ui, -apple-system, sans-serif;
}

/* ---------- Тёмная тема ---------- */
@media (prefers-color-scheme: dark) { :root { --theme: dark; } }

[data-theme="dark"],
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
    --bg:           #141414;
    --bg-sidebar:   #1c1c1c;
    --bg-header:    #1c1c1c;
    --bg-card:      #252525;
    --bg-input:     #1e1e1e;
    --border:       #2e2e2e;
    --text:         #e8e8e8;
    --text-muted:   #888888;
    --text-label:   #cccccc;
    --accent:       #3a8a2a;
    --accent-hover: #4aa338;
    --accent-text:  #ffffff;
    --btn-outline-border: #444444;
    --btn-outline-text:   #cccccc;
    --btn-outline-hover:  #2a2a2a;
    --link:         #5cb84a;
    --shadow:       0 1px 4px rgba(0,0,0,.3);
}}

[data-theme="dark"] {
    --bg:           #141414;
    --bg-sidebar:   #1c1c1c;
    --bg-header:    #1c1c1c;
    --bg-card:      #252525;
    --bg-input:     #1e1e1e;
    --border:       #2e2e2e;
    --text:         #e8e8e8;
    --text-muted:   #888888;
    --text-label:   #cccccc;
    --accent:       #3a8a2a;
    --accent-hover: #4aa338;
    --accent-text:  #ffffff;
    --btn-outline-border: #444444;
    --btn-outline-text:   #cccccc;
    --btn-outline-hover:  #2a2a2a;
    --link:         #5cb84a;
    --shadow:       0 1px 4px rgba(0,0,0,.3);
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
}

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

img { max-width: 100%; display: block; }

/* =============================================
   ХЕДЕР
   ============================================= */
.w-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0;
    z-index: 100;
    padding: 0 16px;
}

/* Логотип */
.w-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    margin-right: 24px;
    flex-shrink: 0;
}
.w-brand img { width: 36px; height: 36px; border-radius: 6px; }
.w-brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.w-brand-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.3px;
    line-height: 1;
}
.w-brand-season {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
}

/* Навигация в хедере */
.w-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.w-nav a {
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
    transition: color .15s, background .15s;
}
.w-nav a:hover { color: var(--text); background: var(--border); }

/* Поиск */
.w-search {
    flex: 1;
    min-width: 0;
    margin: 0 16px;
}
.w-search input {
    width: 100%;
    max-width: 340px;
    padding: 7px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color .15s;
}
.w-search input::placeholder { color: var(--text-muted); }
.w-search input:focus { border-color: var(--accent); }

/* Правая группа хедера */
.w-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Кнопки хедера */
.btn-pill {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--btn-outline-border);
    background: transparent;
    color: var(--btn-outline-text);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background .15s, border-color .15s;
    display: inline-flex;
    align-items: center;
}
.btn-pill:hover { background: var(--btn-outline-hover); text-decoration: none; }

.btn-pill--accent {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
    position: relative;
}
.btn-pill--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Бейдж "скоро" */
.btn-badge {
    position: absolute;
    top: -8px;
    right: -4px;
    background: #e0a020;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    letter-spacing: .3px;
    text-transform: uppercase;
}

/* Переключатель темы */
.w-theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    transition: background .15s;
}
.w-theme-toggle:hover { background: var(--btn-outline-hover); }
.w-theme-toggle svg { width: 18px; height: 18px; }

/* =============================================
   LAYOUT: САЙДБАР + КОНТЕНТ
   ============================================= */
.w-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-h);
}

/* Сайдбар */
.w-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    overflow-y: auto;
    padding: 20px 0;
}

.w-sidebar-section {
    padding: 0 16px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.w-sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}
.w-sidebar-nav li a {
    display: block;
    padding: 7px 20px;
    color: var(--text);
    font-size: 14px;
    text-decoration: none;
    transition: background .12s, color .12s;
    border-left: 3px solid transparent;
}
.w-sidebar-nav li a:hover {
    background: var(--bg);
    color: var(--accent);
    border-left-color: var(--accent);
}
.w-sidebar-nav li a.active {
    background: var(--bg);
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

/* Основной контент */
.w-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    padding: 32px 36px;
}

/* Страницы без сайдбара (авторизация) */
.w-layout--auth .w-sidebar { display: none; }
.w-layout--auth .w-main {
    margin-left: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
}

/* =============================================
   КАРТОЧКИ
   ============================================= */
.w-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.w-card + .w-card { margin-top: 16px; }

.w-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.w-card-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    margin-top: 12px;
    text-decoration: none;
}
.w-card-link:hover { text-decoration: underline; }

/* =============================================
   ФОРМЫ (логин, регистрация)
   ============================================= */
.w-auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 40px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px;
}

.w-auth-card h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.w-auth-card .w-auth-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.w-form { display: flex; flex-direction: column; gap: 16px; }

.w-field { display: flex; flex-direction: column; gap: 5px; }

.w-field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-label);
}

.w-field input {
    padding: 9px 13px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color .15s;
}
.w-field input:focus { border-color: var(--accent); }
.w-field input::placeholder { color: var(--text-muted); }

/* Кнопки форм */
.btn-primary {
    padding: 10px 20px;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: background .15s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }
.btn-primary--full { width: 100%; }

.btn-secondary {
    padding: 9px 20px;
    background: transparent;
    color: var(--btn-outline-text);
    border: 1px solid var(--btn-outline-border);
    border-radius: 7px;
    font-size: 14px;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background .15s;
}
.btn-secondary:hover { background: var(--btn-outline-hover); text-decoration: none; }

/* Ссылки под формой */
.w-auth-links {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}
.w-auth-links a { font-size: 13px; color: var(--link); }
.w-auth-links span { font-size: 13px; color: var(--text-muted); }

/* =============================================
   FLASH-СООБЩЕНИЯ
   ============================================= */
.w-flash {
    padding: 10px 16px;
    border-radius: 7px;
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.w-flash--success { background: #edfaf2; border-color: #a8e6c0; color: #1a5e32; }
.w-flash--error   { background: #fef0f0; border-color: #f5b8b8; color: #8b1a1a; }
.w-flash--info    { background: #eef4fd; border-color: #b8d4f8; color: #1a3d6e; }

[data-theme="dark"] .w-flash--success { background: #1a2e20; border-color: #2d5a3a; color: #7dd6a0; }
[data-theme="dark"] .w-flash--error   { background: #2e1a1a; border-color: #5a2d2d; color: #e08080; }
[data-theme="dark"] .w-flash--info    { background: #1a2030; border-color: #2d4060; color: #80aaee; }

/* =============================================
   СТРАНИЦА: заголовок
   ============================================= */
.w-page-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.w-page-desc  { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }

/* =============================================
   ГЛАВНАЯ СТРАНИЦА
   ============================================= */
.w-home-hero {
    padding: 48px 0 40px;
    max-width: 640px;
}
.w-home-hero h1 { font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.w-home-hero p  { font-size: 15px; color: var(--text-muted); margin-bottom: 28px; line-height: 1.6; }
.w-home-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-outline {
    padding: 10px 20px;
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background .15s;
}
.btn-outline:hover { background: var(--accent); color: #fff; text-decoration: none; }

.w-home-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 40px;
}
.w-feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
}
.w-feature-icon { font-size: 28px; margin-bottom: 12px; }
.w-feature-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.w-feature-card p  { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

/* =============================================
   АДАПТИВ
   ============================================= */
@media (max-width: 899px) {
    .w-sidebar { display: none; }
    .w-main { margin-left: 0; padding: 20px 16px; }
    .w-nav { display: none; }
    .w-search { display: none; }
    .w-auth-card { padding: 24px 20px; }
}
