/* ============================================
   БАЗОВЫЕ СТИЛИ — СВЕТЛАЯ ТЕМА
   ============================================ */

/* 1. Глобальные сбросы и шрифты */
* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

body {
    background-color: #f9fafb !important; /* серый фон для воздушности */
    color: #1f2937 !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
}

/* 2. Убираем жирность и курсив */
h1, h2, h3, h4, h5, h6, b, strong, i, em {
    font-weight: 500 !important;
    font-style: normal !important;
}

h1 { font-size: 28px !important; }
h2 { font-size: 24px !important; }
h3 { font-size: 20px !important; }
h4 { font-size: 18px !important; }

/* 3. Ссылки */
a {
    color: #4f46e5; /* indigo-600 */
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500 !important;
}

a:hover {
    color: #4338ca; /* indigo-700 */
    text-decoration: underline;
}

/* 4. Карточки и блоки */
.card, 
.bg-card,
.rounded-xl {
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

/* 5. Поля ввода — светлая тема */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100% !important;
    background-color: #ffffff !important;
    border: 1px solid #d1d5db !important;
    color: #1f2937 !important;
    padding: 0.6rem 0.75rem !important;
    border-radius: 0.5rem !important;
    font-size: 14px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none !important;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #4f46e5 !important; /* indigo-600 */
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
    ring: 2px solid #4f46e5 !important;
}

/* 6. Кнопки (базовый стиль, если не переопределены в Tailwind) */
button,
.btn {
    font-weight: 500 !important;
    border-radius: 0.5rem !important;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: #4f46e5 !important;
    color: white !important;
    border: none !important;
    padding: 0.6rem 1.5rem !important;
}

.btn-primary:hover {
    background-color: #4338ca !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* 7. Таблицы */
table {
    background-color: transparent !important;
    border-collapse: separate;
    border-spacing: 0;
}

table th {
    background-color: #f9fafb !important;
    color: #374151 !important;
    font-weight: 600 !important;
    padding: 0.75rem !important;
    border-bottom: 2px solid #e5e7eb !important;
}

table td {
    padding: 0.75rem !important;
    border-bottom: 1px solid #f3f4f6 !important;
}

/* 8. Утилиты для отступов и контейнеров */
.container-custom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* 9. Стили для статусов и бейджей */
.badge-success {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
    padding: 0.2rem 0.7rem !important;
    border-radius: 9999px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

.badge-danger {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    padding: 0.2rem 0.7rem !important;
    border-radius: 9999px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

.badge-warning {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    padding: 0.2rem 0.7rem !important;
    border-radius: 9999px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

/* 10. Анимации для плавности */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 11. Стили для сообщений (messages) */
.alert {
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem !important;
    margin-bottom: 1rem !important;
    border: 1px solid transparent !important;
}

.alert-success {
    background-color: #d1fae5 !important;
    border-color: #a7f3d0 !important;
    color: #065f46 !important;
}

.alert-error {
    background-color: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

.alert-info {
    background-color: #dbeafe !important;
    border-color: #bfdbfe !important;
    color: #1e40af !important;
}

/* 12. Адаптив для мобильных */
@media (max-width: 640px) {
    body {
        font-size: 14px !important;
    }
    
    .container-custom {
        padding: 0 1rem;
    }
    
    main {
        padding: 1rem !important;
    }
}



/* ============================================================
   BROKER LOADER — animations
============================================================ */

/* Scan-line: пробегает сверху вниз */
@keyframes scan {
    0%   { transform: translateY(-100%); opacity: 0; }
    20%  { opacity: 1; }
    100% { transform: translateY(700%); opacity: 0; }
}
.animate-scan { animation: scan 2.8s ease-in-out infinite; }

/* «Рисование» графика */
@keyframes draw-line {
    from { stroke-dashoffset: 900; }
    to   { stroke-dashoffset: 0; }
}
.chart-line {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: draw-line 2.4s ease-out forwards;
}

@keyframes fade-area {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.chart-area {
    opacity: 0;
    animation: fade-area 1.4s ease-out 0.8s forwards;
}