@font-face {
    font-family: 'Castellar';
    src: url('../fonts/CASTELAR.TTF') format('truetype');
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/Playfair_Display/static/PlayfairDisplay-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Preciosa';
    src: url('../fonts/Preciosa.ttf') format('truetype');
    font-weight: normal;
    font-display: swap;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: #2c3e50;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav {
    display: flex;
    gap: 2px;
    align-items: center;
    flex-wrap: nowrap;
    min-height: 46px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    transition: background-color 0.2s;
}

nav a:hover {
    background-color: #34495e;
}

.site-heading {
    margin-bottom: 8px;
    line-height: 1.2;
}

.site-heading a {
    color: white;
    text-decoration: none;
}

.site-heading a:hover {
    background: none;
    text-decoration: none;
    opacity: 0.85;
}

.site-heading-en {
    font-family: 'Castellar', 'Palatino Linotype', serif;
    font-weight: normal;
    font-size: 22px;
    letter-spacing: 0.04em;
}

.site-heading-ru {
    font-family: 'Preciosa', 'Playfair Display', 'Palatino Linotype', Georgia, serif;
    font-weight: 600;
    font-size: 27px;
    letter-spacing: 0.09em;
}

.nav-sep {
    color: #4a6278;
    padding: 0 4px;
    font-size: 18px;
    user-select: none;
}

.lang-btn {
    padding: 3px 7px;
    font-size: 13px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
}

.lang-btn-active {
    background-color: #34495e;
}


/* Select2 overrides — match existing form-control style */
.select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    line-height: 38px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
    padding-left: 10px;
    color: #333;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
    margin-right: 18px;
    color: #999;
}
.select2-dropdown {
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}
.select2-search--dropdown .select2-search__field {
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 14px;
}

.flash-messages {
    margin-bottom: 20px;
}

.flash {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.flash.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

footer {
    margin-top: 50px;
    padding: 20px 0;
    text-align: center;
    color: #7f8c8d;
    border-top: 1px solid #ddd;
}

/* Виртуальная клавиатура */
.virtual-keyboard {
    background: #ecf0f1;
    padding: 15px;
    border-radius: 4px;
    margin-top: 10px;
    display: none;
}

.virtual-keyboard.active {
    display: block;
}

.keyboard-section {
    margin-bottom: 10px;
}

.keyboard-section h4 {
    margin-bottom: 5px;
    font-size: 12px;
    color: #7f8c8d;
}

.keyboard-btn {
    display: inline-block;
    padding: 8px 12px;
    margin: 2px;
    background: white;
    border: 1px solid #bdc3c7;
    border-radius: 3px;
    cursor: pointer;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    transition: all 0.2s;
}

.keyboard-btn:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
}

.keyboard-toggle {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 20px;
    padding: 5px;
    margin-left: 5px;
}

.keyboard-toggle:hover {
    color: #2980b9;
}