/*
 * Sentinel One-Time Check - widget styles.
 * Tokens and component shapes follow design/design-doc.html v1.2. Single theme only (no dark
 * variant) - the widget commits to one visual world rather than adapting to host/OS preference.
 * Everything is scoped under .sotc-widget so nothing leaks into (or is overridden by) the host
 * theme's own styles. Always fills 100% of whatever container width the host page gives it.
 */

.sotc-widget {
    --sotc-ink: #10161b;
    --sotc-paper: #f4f6f6;
    --sotc-panel: #ffffff;
    --sotc-line: #d8dee1;
    --sotc-line-strong: #b7c0c4;
    --sotc-muted: #5b6b72;
    --sotc-accent: #0e7c86;
    --sotc-accent-strong: #0b646c;
    --sotc-success: #1f8a4c;
    --sotc-success-soft: #e5f5eb;
    --sotc-warning: #a86412;
    --sotc-warning-soft: #fbf0dd;
    --sotc-error: #b23a26;
    --sotc-error-soft: #fbeae6;
    --sotc-radius: 4px;
    --sotc-control-height: 44px;
    --sotc-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
    --sotc-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    box-sizing: border-box;
    width: 100%;
    font-family: var(--sotc-sans);
    color: var(--sotc-ink);
    line-height: 1.5;
}

.sotc-widget *,
.sotc-widget *::before,
.sotc-widget *::after {
    box-sizing: border-box;
}

.sotc-heading {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
}

.sotc-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sotc-input {
    flex: 1 1 220px;
    min-width: 0;
    height: var(--sotc-control-height);
    padding: 0 13px;
    font-size: 14.5px;
    font-family: var(--sotc-mono);
    color: var(--sotc-ink);
    background: var(--sotc-paper);
    border: 1px solid var(--sotc-line-strong);
    border-radius: var(--sotc-radius);
}

.sotc-input:focus-visible {
    outline: 2px solid var(--sotc-accent);
    outline-offset: 1px;
}

.sotc-btn {
    flex: none;
    height: var(--sotc-control-height);
    padding: 0 20px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: var(--sotc-sans);
    color: #fff;
    background: var(--sotc-accent);
    border: 1px solid var(--sotc-accent);
    border-radius: var(--sotc-radius);
    cursor: pointer;
}

.sotc-btn:hover {
    background: var(--sotc-accent-strong);
    border-color: var(--sotc-accent-strong);
}

.sotc-btn:active {
    transform: translateY(1px);
}

.sotc-btn:focus-visible {
    outline: 2px solid var(--sotc-accent-strong);
    outline-offset: 2px;
}

.sotc-btn[disabled] {
    cursor: not-allowed;
    background: var(--sotc-line-strong);
    border-color: var(--sotc-line-strong);
    color: var(--sotc-muted);
}

.sotc-result {
    margin-top: 16px;
}

.sotc-result:empty {
    margin-top: 0;
}

/* Dual-timezone timestamp - every server timestamp is UTC, local time is derived client-side. */
.sotc-timestamp {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-family: var(--sotc-mono);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sotc-timestamp .sotc-local {
    font-size: 12.5px;
    color: var(--sotc-ink);
}

.sotc-timestamp .sotc-tz {
    font-size: 10px;
    color: var(--sotc-muted);
}

.sotc-timestamp .sotc-sep {
    color: var(--sotc-line-strong);
}

.sotc-timestamp .sotc-utc {
    font-size: 11px;
    color: var(--sotc-muted);
}

/* One vertical card per check type - always stacked, never side-by-side columns. */
.sotc-card {
    border: 1px solid var(--sotc-line);
    border-radius: var(--sotc-radius);
    background: var(--sotc-panel);
    overflow: hidden;
}

.sotc-card + .sotc-card {
    margin-top: 16px;
}

.sotc-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--sotc-line);
    background: var(--sotc-paper);
}

.sotc-card-title {
    display: flex;
    align-items: center;
    gap: 9px;
}

.sotc-card-name {
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.sotc-field-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 11px 18px;
    border-bottom: 1px solid var(--sotc-line);
    gap: 14px;
}

.sotc-field-row:last-child {
    border-bottom: none;
}

.sotc-field-row .sotc-fk {
    font-size: 13px;
    color: var(--sotc-muted);
    flex: none;
    width: 128px;
}

.sotc-field-row .sotc-fv {
    font-family: var(--sotc-mono);
    font-size: 13px;
    text-align: right;
    flex: 1;
    word-break: break-word;
}

.sotc-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--sotc-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    flex: none;
}

.sotc-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.sotc-badge.sotc-success {
    background: var(--sotc-success-soft);
    color: var(--sotc-success);
}

.sotc-badge.sotc-warning {
    background: var(--sotc-warning-soft);
    color: var(--sotc-warning);
}

.sotc-badge.sotc-error {
    background: var(--sotc-error-soft);
    color: var(--sotc-error);
}

/* DNS is a list, not a field set - scrolls horizontally inside its own container so a large
   record set never breaks the host page's own scroll. */
.sotc-dns-table-wrap {
    overflow-x: auto;
}

.sotc-dns-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--sotc-mono);
    font-size: 12.5px;
    min-width: 420px;
}

.sotc-dns-table th {
    text-align: left;
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sotc-muted);
    font-weight: 600;
    padding: 9px 18px;
    border-bottom: 1px solid var(--sotc-line);
    font-family: var(--sotc-sans);
}

.sotc-dns-table td {
    padding: 10px 18px;
    border-bottom: 1px solid var(--sotc-line);
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

.sotc-dns-table tr:last-child td {
    border-bottom: none;
}

.sotc-inline-msg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-radius: var(--sotc-radius);
    border: 1px solid var(--sotc-line);
}

.sotc-inline-msg.sotc-warning {
    background: var(--sotc-warning-soft);
    border-color: var(--sotc-warning);
}

.sotc-inline-msg.sotc-error {
    background: var(--sotc-error-soft);
    border-color: var(--sotc-error);
}

.sotc-inline-msg p {
    margin: 0;
    font-size: 14px;
}

.sotc-inline-msg a {
    color: inherit;
    font-weight: 600;
}

@media (max-width: 360px) {
    .sotc-form {
        flex-direction: column;
    }

    .sotc-btn {
        width: 100%;
    }
}
