/* =========================================================
   Online Notary Center — API console
   Loaded by console.php only; layers on top of docs.css
   ========================================================= */

html {
    scroll-padding-top: 165px;
}

.console-hero {
    padding: 3rem 0 2.5rem;
}

.console-hero h1 {
    font-size: 34px;
}

.console-hero p {
    font-size: 16px;
}

/* ---------- Sticky credential bar ---------- */

.api-console {
    position: sticky;
    top: 76px;
    /* one below the navbar's sticky-top so the two never fight for the strip */
    z-index: 1019;
    background: #10151b;
    color: #d8e2ec;
    border-bottom: 1px solid #24303c;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}

.api-console .console-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem 0;
    flex-wrap: wrap;
}

.api-console label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #8ba0b4;
    margin-bottom: .2rem;
    display: block;
}

.api-console .label-note {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.api-console .console-field {
    flex: 1 1 260px;
    min-width: 0;
}

.api-console .console-field.is-narrow {
    flex: 0 1 230px;
}

.api-console input[type="text"],
.api-console input[type="password"] {
    width: 100%;
    background: #1a222b;
    border: 1px solid #2c3947;
    border-radius: 8px;
    color: #e8eef4;
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    padding: .45rem .7rem;
}

.api-console input:focus {
    outline: none;
    border-color: var(--web-blue);
    box-shadow: 0 0 0 3px rgba(64, 161, 232, .18);
}

.api-console code {
    color: #8ecbf5;
}

.console-btn {
    background: #24303c;
    border: 1px solid #33424f;
    color: #d8e2ec;
    border-radius: 8px;
    font-size: 13px;
    padding: .45rem .85rem;
    white-space: nowrap;
    transition: var(--transition);
}

.console-btn:hover,
.console-btn.is-open {
    background: var(--web-blue);
    border-color: var(--web-blue);
    color: var(--white);
}

.console-state {
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    padding: .25rem .75rem;
    white-space: nowrap;
}

.console-state.is-on {
    background: rgba(46, 158, 107, .18);
    color: #6ede9f;
    border: 1px solid rgba(46, 158, 107, .5);
}

.console-state.is-off {
    background: rgba(214, 57, 57, .15);
    color: #ff9c9c;
    border: 1px solid rgba(214, 57, 57, .45);
}

#consoleBody {
    display: none;
    border-top: 1px solid #24303c;
    padding: 1rem 0 1.1rem;
}

.console-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .8rem;
}

.console-legend {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6f8296;
    margin: 1rem 0 .5rem;
}

.console-hint {
    font-size: 12px;
    color: #8ba0b4;
}

.console-modes {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    font-size: 13px;
}

.console-modes label {
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
    font-weight: 400;
    color: #d8e2ec;
    display: flex;
    align-items: center;
    gap: .35rem;
    margin: 0;
}

#consoleFlash {
    display: none;
    font-size: 12px;
    color: var(--web-yellow);
}

/* ---------- Sidebar ---------- */

.console-sidebar {
    top: 165px;
    max-height: calc(100vh - 185px);
}

.endpoint-filter {
    width: 100%;
    border: 1px solid #d8e0e9;
    border-radius: 20px;
    font-size: 13px;
    padding: .4rem .9rem;
    margin-bottom: .5rem;
}

.endpoint-filter:focus {
    outline: none;
    border-color: var(--web-blue);
    box-shadow: 0 0 0 3px rgba(64, 161, 232, .15);
}

.console-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.side-method {
    flex: 0 0 34px;
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    text-align: center;
    border-radius: 4px;
    padding: .15rem 0;
    color: var(--white);
}

.side-get { background: #2e9e6b; }
.side-post { background: var(--web-blue); }

.sidebar-foot {
    font-size: 12px;
    color: #6c757d;
    margin: 1.5rem 0 0;
}

/* ---------- Toolbar ---------- */

.console-toolbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1.25rem;
}

.toolbar-count {
    font-size: 13px;
    color: #6c757d;
    margin-right: auto;
}

.console-group {
    font-size: 22px;
    font-weight: 600;
    margin: 2rem 0 1rem;
}

.console-group:first-of-type {
    margin-top: 0;
}

.no-match {
    color: #6c757d;
    font-size: 14px;
}

/* ---------- Endpoint card ---------- */

.try-panel {
    scroll-margin-top: 165px;
}

.try-panel .card-header.try-toggle {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 100%;
    text-align: left;
    border: none;
    border-bottom: 1px solid #e3e8ee;
    cursor: pointer;
    transition: var(--transition);
}

.try-panel .card-header.try-toggle:hover {
    background: var(--web-blue-soft);
}

.try-chevron {
    color: #9aa7b4;
    font-size: 14px;
    transition: transform 200ms ease;
}

.try-toggle.is-open .try-chevron {
    transform: rotate(90deg);
}

.try-head-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.try-title {
    font-size: 16px;
    font-weight: 500;
}

.try-path {
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: #6c757d;
    word-break: break-all;
}

.try-flag {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 500;
    color: #8a6100;
    background: #fff3d1;
    border: 1px solid #ffe08a;
    border-radius: 20px;
    padding: .15rem .6rem;
}

.try-body {
    display: none;
}

.try-desc {
    font-size: 14px;
    color: #495057;
    margin-bottom: 1rem;
}

.try-desc a {
    color: var(--web-blue-dark);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}

.try-desc a:hover {
    color: var(--web-blue);
    text-decoration: underline;
}

.try-legend {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6c757d;
    margin-bottom: .4rem;
}

.try-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: .7rem;
    margin-bottom: 1rem;
}

.try-grid label {
    display: block;
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: #495057;
    margin-bottom: .2rem;
}

.try-grid .req-dot {
    color: #d63939;
}

.try-panel input[type="text"],
.try-panel input[type="file"],
.try-panel textarea {
    width: 100%;
    border: 1px solid #d8e0e9;
    border-radius: 8px;
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    padding: .45rem .7rem;
    background: var(--white);
}

.try-panel input:focus,
.try-panel textarea:focus {
    outline: none;
    border-color: var(--web-blue);
    box-shadow: 0 0 0 3px rgba(64, 161, 232, .15);
}

.try-panel textarea.try-json {
    min-height: 200px;
    line-height: 1.5;
    background: #f7f9fc;
}

.try-panel input[readonly] {
    background: #f1f4f8;
    color: #6c757d;
}

.try-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    margin-top: .9rem;
}

.btn-send {
    background: var(--web-blue);
    border: none;
    color: var(--white);
    font-weight: 500;
    border-radius: 20px;
    padding: .45rem 1.6rem;
    transition: var(--transition);
}

.btn-send:hover {
    background: var(--web-blue-dark);
}

.btn-send:disabled {
    background: #9dc4e3;
    cursor: progress;
}

.btn-ghost {
    background: transparent;
    border: 1px solid #d8e0e9;
    color: #495057;
    border-radius: 20px;
    font-size: 13px;
    padding: .4rem 1rem;
    transition: var(--transition);
}

.btn-ghost:hover {
    border-color: var(--web-blue);
    color: var(--web-blue-dark);
}

.try-hint {
    font-size: 12px;
    color: #6c757d;
}

.try-error {
    margin-top: .8rem;
    border-left: 4px solid #d63939;
    background: #fdf0f0;
    color: #a02121;
    border-radius: 0 8px 8px 0;
    padding: .6rem .85rem;
    font-size: 13px;
}

.try-error a {
    color: #a02121;
}

/* ---------- Response ---------- */

.try-response {
    margin-top: 1.1rem;
}

.resp-meta {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: .4rem;
}

.resp-status {
    font-weight: 600;
    border-radius: 6px;
    padding: .15rem .55rem;
    color: var(--white);
}

.resp-status.is-ok { background: #2e9e6b; }
.resp-status.is-warn { background: #e08a1e; }
.resp-status.is-error { background: #d63939; }

.resp-url {
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-all;
}

.resp-body {
    background: var(--code-bg);
    color: #d8e2ec;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    font-size: 13px;
    line-height: 1.55;
    max-height: 460px;
    overflow: auto;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.resp-body .tk-key { color: #8ecbf5; }
.resp-body .tk-str { color: #ffd97a; }
.resp-body .tk-num { color: #a5e0a5; }
.resp-body .tk-cmt { color: #7d8da0; }

.resp-note {
    display: inline-block;
    margin-top: .55rem;
    font-size: 12px;
    color: #2e9e6b;
}

.resp-download {
    display: inline-block;
    margin-top: .6rem;
    background: var(--web-yellow);
    color: var(--font-black);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    padding: .35rem 1rem;
    text-decoration: none;
    transition: var(--transition);
}

.resp-download:hover {
    background: var(--web-blue);
    color: var(--white);
}

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {

    /* The bar wraps onto several rows on phones — pinning it there would
       eat most of the viewport, so it scrolls away instead. */
    .api-console {
        position: static;
    }

    .console-sidebar {
        top: auto;
    }

    html {
        scroll-padding-top: 90px;
    }

    .try-panel {
        scroll-margin-top: 90px;
    }
}
