:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
    --danger: #ef4444;
    --success: #22c55e;
    --gray: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Навигация */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #334155;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    text-decoration: none;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 20px;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Контейнеры */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

/* Сетка шаблонов */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.template-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s;
    border: 1px solid #334155;
}

.template-card:hover {
    transform: translateY(-5px);
}

.template-img {
    width: 100%;
    height: 180px;
    background: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
}

.template-info {
    padding: 20px;
}

.template-info h3 {
    margin-bottom: 10px;
}

.price {
    font-size: 1.2rem;
    color: var(--accent-color);
    font-weight: bold;
    display: block;
    margin-bottom: 15px;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--accent-color);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-outline {
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    background: transparent;
}

.btn-outline:hover {
    background: var(--accent-color);
    color: #000;
}

/* Формы (Логин/Рег) */
.auth-form {
    max-width: 400px;
    margin: 100px auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.auth-form input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: #0f172a;
    border: 1px solid #334155;
    color: white;
    border-radius: 6px;
}

/* Редактор */
.editor-container {
    display: flex;
    height: calc(100vh - 70px);
}

#code-editor {
    width: 50%;
    height: 100%;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    font-family: 'Courier New', monospace;
    border: none;
    resize: none;
    outline: none;
}

#preview-frame {
    width: 50%;
    height: 100%;
    background: white;
    border: none;
}

.editor-header {
    background: #1e293b;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Уведомления */
.status-msg {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    display: none;
}