/* =====================================================================
   PayHub API Docs — стиль лендинга на бренд-токенах (tokens.css).
   Никакого DevExpress: нативные элементы + фиолетовая палитра PayHub.
   ===================================================================== */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--ph-font-family);
    font-size: var(--ph-font-size-base);
    color: var(--ph-text-primary);
    background: var(--ph-bg-body);
    scroll-behavior: smooth;
}

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

code, pre, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ── Boot-screen (до загрузки WASM) ───────────────────────────────── */
.boot-screen {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 18px;
    background: linear-gradient(135deg, #f0eeff 0%, #e8f0ff 50%, #f5f0ff 100%);
}
.boot-logo { width: 200px; height: auto; }
.boot-text { color: #7a7a9a; font-size: 0.9rem; }

#blazor-error-ui {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #f3545d; color: #fff; padding: 10px 16px; z-index: 30000;
}
#blazor-error-ui .reload { color: #fff; text-decoration: underline; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* =====================================================================
   ЛОГИН (нативная форма, визуал из authorization.css)
   ===================================================================== */
.login-bg {
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 22px;
    background: linear-gradient(135deg, #f0eeff 0%, #e8f0ff 50%, #f5f0ff 100%);
    padding: 20px;
}
.login-title {
    margin: 0;
    text-align: center;
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, #6b52c8 0%, #4e3b8c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #4e3b8c;
    animation: login-appear 0.35s cubic-bezier(.22,.68,0,1.2);
}
@media (max-width: 480px) {
    .login-title { font-size: 2rem; }
}
.login-card {
    width: 100%; max-width: 420px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(200, 190, 240, 0.5);
    border-radius: 20px;
    padding: 40px 36px 32px;
    box-shadow: 0 8px 40px rgba(80, 50, 160, 0.10), 0 2px 8px rgba(0,0,0,0.06);
    animation: login-appear 0.35s cubic-bezier(.22,.68,0,1.2);
}
@keyframes login-appear {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-logo-wrap { text-align: center; margin-bottom: 6px; }
.login-logo-img { width: 200px; height: auto; max-width: 100%; }
.login-badge {
    display: inline-block; margin: 2px auto 0;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em;
    color: #6b52c8; text-transform: uppercase;
}
.login-subtitle {
    text-align: center; font-size: 0.85rem; color: #7a7a9a;
    margin: 6px 0 26px; font-weight: 400;
}
.login-field { margin-bottom: 18px; }
.login-label {
    display: block; font-size: 0.78rem; font-weight: 600;
    color: #4a4470; margin-bottom: 6px; letter-spacing: 0.03em;
}
.login-input {
    width: 100%; padding: 11px 12px;
    border-radius: 10px; border: 1px solid #d0cce8; background: #fff;
    color: #2e2a45; font-size: 0.9rem; font-family: var(--ph-font-family);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input:focus {
    outline: none; border-color: #7c6bc4;
    box-shadow: 0 0 0 3px rgba(124, 107, 196, 0.15);
}
.login-btn {
    width: 100%; padding: 11px 0; border: none; border-radius: 12px;
    font-size: 0.95rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 6px; letter-spacing: 0.03em; color: #fff;
    background: linear-gradient(135deg, #6b52c8 0%, #4e3b8c 100%);
    box-shadow: 0 4px 16px rgba(78, 59, 140, 0.35);
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}
.login-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #7c62d8 0%, #5e4a9e 100%);
    box-shadow: 0 6px 20px rgba(78, 59, 140, 0.45); transform: translateY(-1px);
}
.login-btn:disabled { opacity: 0.7; cursor: default; }
.login-error {
    margin-top: 14px; padding: 10px 12px; border-radius: 10px;
    background: rgba(243, 84, 93, 0.10); border: 1px solid rgba(243, 84, 93, 0.3);
    color: #cf222e; font-size: 0.82rem; text-align: center;
}
.login-footer { text-align: center; margin-top: 18px; }
.login-hint { font-size: 0.82rem; color: #7a7a9a; margin-bottom: 6px; }
.login-request {
    background: none; border: none; color: #6b52c8;
    font-size: 0.88rem; font-weight: 600; cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px;
}

/* =====================================================================
   МАКЕТ ДОКУМЕНТАЦИИ (сайдбар + контент)
   ===================================================================== */
.docs-shell { display: flex; min-height: 100vh; }

/* ── Левый сайдбар ──────────────────────────────────────────────── */
.docs-sidebar {
    width: 280px; flex: 0 0 280px;
    position: sticky; top: 0; align-self: flex-start;
    height: 100vh; overflow-y: auto;
    background: linear-gradient(180deg, var(--ph-bg-sidebar) 0%, var(--ph-bg-sidebar-end) 100%);
    color: #e9e6f7; padding: 22px 0;
}
.docs-sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 0 22px 18px; }
.docs-sidebar-logo img { width: 150px; height: auto; }
.docs-nav-group-title {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
    color: rgba(255,255,255,0.45); padding: 14px 22px 6px; font-weight: 700;
}
.docs-nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 22px; color: rgba(255,255,255,0.78);
    font-size: 0.88rem; cursor: pointer; border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.docs-nav-link:hover { background: var(--ph-bg-sidebar-item-hover); color: #fff; text-decoration: none; }
.docs-nav-link.active {
    background: var(--ph-bg-sidebar-item-active); color: #fff;
    border-left-color: #b9a7ff; font-weight: 600;
}
.docs-nav-link i { width: 18px; text-align: center; opacity: 0.9; }

.docs-sidebar-user {
    margin: 14px 22px 0; padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.12);
    font-size: 0.78rem; color: rgba(255,255,255,0.6);
}
.docs-logout {
    margin-top: 8px; background: rgba(255,255,255,0.08); color: #fff;
    border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
    padding: 6px 12px; font-size: 0.8rem; cursor: pointer; width: 100%;
}
.docs-logout:hover { background: rgba(255,255,255,0.16); }

/* ── Контент ────────────────────────────────────────────────────── */
.docs-content { flex: 1 1 auto; min-width: 0; padding: 0 0 120px; }
.docs-hero {
    padding: 48px 48px 36px;
    background: linear-gradient(135deg, #f0eeff 0%, #e8f0ff 60%, #f5f0ff 100%);
    border-bottom: 1px solid var(--ph-border-color);
}
.docs-hero h1 { margin: 0 0 8px; font-size: 2rem; color: #2A2F5B; }
.docs-hero p { margin: 0; color: #6a6a86; max-width: 720px; }
.docs-merchant-pill {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
    background: #fff; border: 1px solid var(--ph-border-color);
    border-radius: 999px; padding: 7px 14px; font-size: 0.84rem;
    box-shadow: var(--ph-shadow-sm);
}
.docs-merchant-pill code { color: var(--ph-color-accent); font-weight: 600; }
.docs-merchant-input {
    border: 1px solid #d0cce8; border-radius: 8px; padding: 5px 10px;
    font-size: 0.82rem; font-family: 'JetBrains Mono', monospace; width: 320px; max-width: 60vw;
}

.docs-section { padding: 40px 48px; border-bottom: 1px solid var(--ph-border-color); scroll-margin-top: 12px; }
.docs-section > h2 {
    margin: 0 0 6px; font-size: 1.5rem; color: #2A2F5B;
    display: flex; align-items: center; gap: 10px;
}
.docs-section-desc { color: #6a6a86; margin: 0 0 22px; max-width: 760px; }

.docs-card {
    background: var(--ph-bg-card); border: 1px solid var(--ph-border-color);
    border-radius: var(--ph-border-radius); box-shadow: var(--ph-shadow-sm);
    padding: 22px; margin-bottom: 22px;
}

/* ── Таблицы полей ──────────────────────────────────────────────── */
.docs-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin: 6px 0 4px; }
.docs-table th {
    text-align: left; font-weight: 700; color: var(--ph-text-secondary);
    border-bottom: 2px solid var(--ph-border-color); padding: 8px 10px; white-space: nowrap;
}
.docs-table td { padding: 8px 10px; border-bottom: 1px solid var(--ph-border-color); vertical-align: top; }
.docs-table td code { background: #f3f1fb; border-radius: 5px; padding: 1px 6px; color: var(--ph-color-accent); }
.docs-req { color: #f3545d; font-weight: 700; }
.docs-opt { color: #95aac9; }

/* ── Пронумерованные шаги флоу ─────────────────────────────────── */
.docs-steps { list-style: none; margin: 0 0 22px; padding: 0; max-width: 760px; display: flex; flex-direction: column; gap: 12px; }
.docs-steps li { display: flex; align-items: flex-start; gap: 12px; color: var(--ph-text-secondary); line-height: 1.55; }
.docs-steps .docs-step-num {
    flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%;
    background: var(--ph-color-accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 700;
}

/* =====================================================================
   TRY-IT (Postman-стиль)
   ===================================================================== */
.tryit {
    border: 1px solid var(--ph-border-color); border-radius: var(--ph-border-radius);
    overflow: hidden; background: #fbfaff; margin-top: 8px;
}
.tryit-head {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 12px 14px; background: #f4f1fc; border-bottom: 1px solid var(--ph-border-color);
}
.method-badge {
    font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 0.75rem;
    padding: 4px 10px; border-radius: 6px; color: #fff; letter-spacing: 0.04em;
}
.method-GET { background: #35cd3a; }
.method-POST { background: #177dff; }
.method-PUT { background: #ffa534; }
.method-DELETE { background: #f3545d; }
.tryit-url {
    flex: 1 1 320px; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
    color: #4a4470; word-break: break-all;
}
.tryit-send {
    background: linear-gradient(135deg, #6b52c8 0%, #4e3b8c 100%); color: #fff;
    border: none; border-radius: 9px; padding: 8px 20px; font-weight: 600;
    cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.tryit-send:hover:not(:disabled) { background: linear-gradient(135deg, #7c62d8 0%, #5e4a9e 100%); }
.tryit-send:disabled { opacity: 0.6; cursor: default; }

/* Мини-кнопка копирования (URL / тело запроса) */
.copy-mini {
    background: #fff;
    border: 1px solid var(--ph-border-color);
    border-radius: 7px;
    padding: 5px 9px;
    font-size: 0.76rem;
    cursor: pointer;
    color: #4a4470;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.copy-mini:hover { color: #4e3b8c; border-color: #7c6bc4; background: #f4f1fc; }

.tryit-body { padding: 14px; }

.tryit-jsonbody-label {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.tryit-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tryit-field label {
    display: block; font-size: 0.74rem; font-weight: 600; color: #4a4470; margin-bottom: 4px;
}
.tryit-field label .req { color: #f3545d; }
.tryit-field input, .tryit-field select, .tryit-field textarea {
    width: 100%; padding: 8px 10px; border: 1px solid #d6d2ec; border-radius: 8px;
    font-size: 0.84rem; font-family: 'JetBrains Mono', monospace; background: #fff; color: #2e2a45;
}
.tryit-field input:focus, .tryit-field select:focus, .tryit-field textarea:focus {
    outline: none; border-color: #7c6bc4; box-shadow: 0 0 0 3px rgba(124,107,196,0.12);
}
.tryit-field input:read-only { background: #f3f1fb; color: #6a6a86; }
.tryit-jsonbody { margin-top: 12px; }
.tryit-jsonbody label { display:block; font-size: 0.74rem; font-weight: 600; color: #4a4470; margin-bottom: 4px; }
.tryit-jsonbody textarea {
    width: 100%; min-height: 150px; resize: vertical; padding: 10px 12px;
    border: 1px solid #d6d2ec; border-radius: 8px; font-size: 0.82rem;
    font-family: 'JetBrains Mono', monospace; background: #1e1b2e; color: #d8d4f0; line-height: 1.5;
}

/* ── Ответ ──────────────────────────────────────────────────────── */
.resp { margin-top: 14px; border: 1px solid var(--ph-border-color); border-radius: 10px; overflow: hidden; }
.resp-head {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    background: #f4f1fc; border-bottom: 1px solid var(--ph-border-color);
}
.status-badge {
    font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 0.82rem;
    padding: 4px 12px; border-radius: 999px; color: #fff;
}
.status-2xx { background: #35cd3a; }
.status-4xx, .status-5xx { background: #f3545d; }
.status-net { background: #95aac9; }
.status-3xx { background: #ffa534; }
.resp-time { font-size: 0.78rem; color: #95aac9; }
.resp-copy {
    margin-left: auto; background: #fff; border: 1px solid var(--ph-border-color);
    border-radius: 8px; padding: 5px 12px; font-size: 0.78rem; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px; color: #4a4470;
}
.resp-copy:hover { border-color: #7c6bc4; color: #4e3b8c; }
.resp-body {
    margin: 0; padding: 14px; background: #1e1b2e; color: #d8d4f0;
    font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; line-height: 1.5;
    max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}

/* ── Раскрывающийся блок «Примеры ответов» ──────────────────────── */
.resp-examples {
    margin-top: 14px;
    border: 1px solid var(--ph-border-color);
    border-radius: 10px;
    background: #fbfaff;
    overflow: hidden;
}
.resp-examples > summary {
    cursor: pointer;
    padding: 11px 14px;
    font-weight: 600;
    font-size: 0.86rem;
    color: #4a4470;
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    user-select: none;
}
.resp-examples > summary::-webkit-details-marker { display: none; }
.resp-examples > summary::before {
    content: "\F285"; /* bi-chevron-right */
    font-family: "bootstrap-icons";
    font-size: 0.8rem;
    transition: transform 0.2s;
    color: var(--ph-color-secondary);
}
.resp-examples[open] > summary::before { transform: rotate(90deg); }
.resp-examples > summary:hover { background: #f4f1fc; }
.resp-examples-count {
    margin-left: auto;
    background: var(--ph-color-secondary);
    color: #fff;
    border-radius: 999px;
    padding: 1px 9px;
    font-size: 0.74rem;
}
.resp-examples-body { padding: 4px 12px 12px; }
.resp-example { margin-top: 10px; }
.resp-example-head {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 0;
}
.resp-example-label { font-size: 0.82rem; color: #575962; font-weight: 500; }
.resp-example .resp-copy { margin-left: auto; }
.resp-example .resp-body { margin: 0; border-radius: 8px; max-height: 340px; }

/* ── Подсветка JSON ─────────────────────────────────────────────── */
.resp-body .jkey  { color: #9db4ff; }
.resp-body .jstr  { color: #7ee787; }
.resp-body .jnum  { color: #ffb86c; }
.resp-body .jbool { color: #d2a8ff; }

/* ── Код-блоки (примеры) ────────────────────────────────────────── */
pre.codeblock {
    background: #1e1b2e; color: #d8d4f0; border-radius: 10px; padding: 14px 16px;
    overflow: auto; font-size: 0.8rem; line-height: 1.5; margin: 10px 0;
}
.inline-code { background: #f3f1fb; border-radius: 5px; padding: 1px 6px; color: var(--ph-color-accent); font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }

/* ── Справочники (банки/фиаты) ──────────────────────────────────── */
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.ref-block h4 { margin: 0 0 8px; font-size: 1rem; color: #2A2F5B; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.ref-table td { padding: 4px 8px; border-bottom: 1px solid var(--ph-border-color); }
.ref-table td:first-child { color: var(--ph-color-accent); font-weight: 600; font-family: 'JetBrains Mono', monospace; width: 70px; }

/* ── Callout ────────────────────────────────────────────────────── */
.callout {
    border-left: 4px solid var(--ph-color-secondary); background: #f5f3fd;
    padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 12px 0; font-size: 0.86rem;
}
.callout.warn { border-left-color: #ffa534; background: #fff7ec; }

/* ── Мобильный сайдбар ──────────────────────────────────────────── */
.docs-burger { display: none; }
@media (max-width: 980px) {
    .docs-sidebar {
        position: fixed; left: 0; top: 0; z-index: 5000;
        transform: translateX(-100%); transition: transform 0.25s; box-shadow: var(--ph-shadow-lg);
    }
    .docs-sidebar.open { transform: translateX(0); }
    .docs-burger {
        display: inline-flex; position: fixed; top: 14px; left: 14px; z-index: 4000;
        background: linear-gradient(135deg, #6b52c8 0%, #4e3b8c 100%); color: #fff;
        border: none; border-radius: 10px; width: 44px; height: 44px;
        align-items: center; justify-content: center; font-size: 1.3rem; cursor: pointer;
        box-shadow: var(--ph-shadow-md);
    }
    .docs-hero, .docs-section { padding-left: 20px; padding-right: 20px; }
    .docs-hero { padding-top: 70px; }
}
