:root {
    --bg-dark: #0a1020;
    --surface-color: #16213a;
    --surface-elevated: #1e2944;
    --surface-action: #0d121c;
    --text-primary: #f1f5fa;
    --text-secondary: #d8d8d8;
    --text-muted: #6b7fa7;
    --primary-blue: #3b82f6;
    --primary-blue-hover: #2563eb;
    --accent-orange: #f59e0b;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --border-dim: rgba(255, 255, 255, 0.08);
    --radius: 16px;
    --radius-md: 12px;
    --card-shadow: 0 8px 32px 0 rgba(10, 16, 32, 0.4);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(180deg, #1a237e 0%, #0a1020 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

main {
    padding: 1rem;
    padding-top: 80px;
    padding-bottom: 60px;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 650px;
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* --- ТИТУЛ И ОПИСАНИЕ --- */
.api-hero { 
    text-align: center; /* Вернули по центру */
}
.api-hero h1 { 
    margin: 0; 
    font-size: 1.8rem; 
    font-weight: 800; 
    background: linear-gradient(90deg, #fff, #93c5fd); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    display: inline-block;
}

.title-separator {
    height: 2px;
    width: 100%; /* Растягивает полоску на всю доступную ширину */
    background: #2f3f67;
    border-radius: 2px;
    margin: 16px 0 20px 0; /* Отступы сверху и снизу */
}

.api-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    text-align: left; /* Выравнивает текст по левому краю */
}
.api-description strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* --- КАРТОЧКИ --- */
.api-card {
    background: var(--surface-elevated);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    border: 1px solid var(--border-dim);
}

.card-header {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 1rem;
    margin-bottom: 15px;
}
.card-header svg { width: 20px; height: 20px; color: #94a3b8; }

.url-display {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface-action);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.05);
}
.url-display code { font-family: monospace; font-size: 0.8rem; color: #cbd5e1; word-break: break-all; }

/* --- КЛЮЧИ --- */
.key-tier { display: flex; flex-direction: column; gap: 12px; }
.key-info { display: flex; justify-content: space-between; align-items: center; }
.key-title { font-weight: 700; font-size: 0.95rem; }
.basic-color { color: var(--primary-blue); }
.pro-color { color: var(--accent-orange); }
.key-limits { font-size: 0.8rem; color: var(--text-muted); }

.divider {
    height: 1px;
    background: var(--border-dim);
    margin: 1.2rem 0;
}

/* Кнопки и жесткий фикс SVG */
.action-btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    text-decoration: none;
    font-family: inherit;
    box-sizing: border-box;
}

/* Принудительно ограничиваем ВСЕ иконки внутри кнопок */
.action-btn svg {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0;
}

.action-btn:active { transform: scale(0.98); }

.primary-btn { background: var(--primary-blue); color: #fff; }
.pro-btn { background: rgba(245, 158, 11, 0.1); color: var(--accent-orange); border: 1px solid rgba(245, 158, 11, 0.3); }
.swagger-btn { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.3); }

.key-display-wrapper {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface-action);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--accent-green);
    animation: fadeIn 0.3s ease;
}
.key-display-wrapper code { color: var(--accent-green); font-family: monospace; font-size: 0.9rem; word-break: break-all; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.icon-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    padding: 4px; display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: #fff; }
.icon-btn svg { width: 18px; height: 18px; }

/* --- МОДАЛКА --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(5px);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
    box-sizing: border-box; /* ФИКС ЦЕНТРИРОВАНИЯ (overlay) */
}
.confirm-modal, .sub-modal-content {
    background: var(--surface-color);
    width: 100%; max-width: 320px;
    border-radius: var(--radius);
    padding: 24px; text-align: center;
    border: 1px solid var(--border-dim);
    animation: popIn 0.2s ease-out;
    box-sizing: border-box; /* ФИКС ЦЕНТРИРОВАНИЯ (самого окна) */
}
@keyframes popIn { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.modal-icon svg { width: 40px; height: 40px; color: var(--accent-red); margin-bottom: 15px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-cancel, .btn-confirm { flex: 1; padding: 12px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; transition: 0.2s;}
.btn-cancel { background: var(--surface-elevated); color: var(--text-primary); }
.btn-confirm { background: var(--accent-red); color: #fff; }
.btn-cancel:active, .btn-confirm:active { transform: scale(0.96); }

/* СТИЛЬ ДЛЯ ОТКЛЮЧЕННОГО SWAGGER */
.swagger-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(16, 185, 129, 0.05);
}
.swagger-btn.disabled:active {
    transform: none;
}

