/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --cyon-orange:    #FF5F00;
    --cyon-orange-dk: #e55500;
    --text-primary:   #1a1a1a;
    --text-secondary: #666666;
    --text-muted:     #999999;
    --bg-page:        #f2f4f7;
    --bg-card:        #ffffff;
    --border:         #e0e4ea;
    --border-focus:   #FF5F00;
    --error-bg:       #fff3f2;
    --error-border:   #d32f2f;
    --error-text:     #b71c1c;
    --success-bg:     #f0faf4;
    --success-text:   #1b5e20;
    --code-bg:        #1e1e2e;
    --code-text:      #cdd6f4;
    --radius-sm:      4px;
    --radius-md:      8px;
    --radius-lg:      12px;
    --shadow-card:    0 2px 12px rgba(0, 0, 0, 0.08);
    --transition:     0.18s ease;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
    line-height: 1.5;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.page-wrapper {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.75rem 0 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.site-header .logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.logo-mark {
    width: 36px;
    height: 36px;
    background: var(--cyon-orange);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-mark svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.logo-text span {
    color: var(--cyon-orange);
}

.header-divider {
    flex: 1;
}

.header-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: var(--border);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

/* ── Page title ───────────────────────────────────────────────────────────── */
.page-title {
    margin-bottom: 1.5rem;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
}

.page-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
}

/* ── Lookup form ──────────────────────────────────────────────────────────── */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.input-row {
    display: flex;
    gap: 0.625rem;
    align-items: stretch;
}

.domain-input {
    flex: 1;
    height: 46px;
    padding: 0 0.875rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    min-width: 0;
}

.domain-input::placeholder {
    color: var(--text-muted);
}

.domain-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(255, 95, 0, 0.12);
}

.domain-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 46px;
    padding: 0 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition),
                color var(--transition), box-shadow var(--transition), opacity var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--cyon-orange);
    color: #fff;
    border-color: var(--cyon-orange);
}

.btn-primary:hover:not(:disabled) {
    background: var(--cyon-orange-dk);
    border-color: var(--cyon-orange-dk);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-page);
    border-color: #bfc5cf;
}

.btn-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-sm {
    height: 36px;
    padding: 0 0.875rem;
    font-size: 0.83rem;
}

/* ── Domain preview hint ──────────────────────────────────────────────────── */
.domain-hint {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    min-height: 1.2em;
}

.domain-hint .hint-sanitized {
    color: var(--cyon-orange);
    font-weight: 500;
}

/* ── Spinner ──────────────────────────────────────────────────────────────── */
.spinner-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--cyon-orange);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Error / status message ───────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.5;
}

.alert-icon {
    flex-shrink: 0;
    margin-top: 0.1em;
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid #fca5a5;
    color: var(--error-text);
}

/* ── Output section ───────────────────────────────────────────────────────── */
.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.output-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.output-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── JSON output area ─────────────────────────────────────────────────────── */
.json-output {
    background: var(--code-bg);
    color: var(--code-text);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.825rem;
    line-height: 1.65;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 62vh;
    white-space: pre;
    tab-size: 2;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Syntax highlighting */
.json-key     { color: #9cdcfe; }
.json-string  { color: #ce9178; }
.json-number  { color: #b5cea8; }
.json-bool    { color: #569cd6; }
.json-null    { color: #569cd6; }

/* ── Copy success state ───────────────────────────────────────────────────── */
.btn-copy-success {
    background: var(--success-bg) !important;
    border-color: #86efac !important;
    color: var(--success-text) !important;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding-top: 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.site-footer a {
    color: var(--cyon-orange);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
[hidden] { display: none !important; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .card {
        padding: 1.25rem;
    }

    .input-row {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .output-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .json-output {
        font-size: 0.75rem;
    }
}
