:root {
    --bg-colour: #fafafa;
    --text-main: #111827;
    --text-muted: #4b5563;
    --primary-colour: #0f172a;
    --primary-hover: #334155;
    --border-colour: #e5e7eb;
    --card-bg: #ffffff;
    --focus-ring: rgba(15, 23, 42, 0.2);
    --success-bg: #dcfce7;
    --success-text: #166534;
    --error-bg: #fee2e2;
    --error-text: #991b1b;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-colour);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography & Utilities */
h1 { font-size: 3rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-size: 2rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.125rem; font-weight: 600; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.font-weight-bold { font-weight: 700; }
.visually-hidden { display: none !important; }
.hidden { display: none; }
.w-full { width: 100%; }

/* Spacing */
.mt-xs { margin-top: 0.5rem; }
.mb-xs { margin-bottom: 0.5rem; }
.mt-sm { margin-top: 1.5rem; }
.mb-sm { margin-bottom: 1.5rem; }
.mt-md { margin-top: 2.5rem; }
.mb-md { margin-bottom: 2.5rem; }
.pt-md { padding-top: 3rem; }
.pb-md { padding-bottom: 3rem; }
.pt-lg { padding-top: 5rem; }
.pb-lg { padding-bottom: 5rem; }
.pt-xl { padding-top: 7rem; }
.pb-xl { padding-bottom: 7rem; }

/* Layout */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.align-start { align-items: start; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Components */
.gradient-text {
    background: linear-gradient(90deg, #111827 0%, #4b5563 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.btn-primary {
    background-color: var(--primary-colour);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text-main);
    border-color: var(--border-colour);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-secondary:hover {
    background-color: #f3f4f6;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-colour);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Form Styles */
.form-section {
    max-height: 2000px; /* Arbitrary large number for max-height transition */
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.6s ease-in-out, opacity 0.5s ease-in-out, transform 0.5s ease;
    transform: translateY(0);
}

.form-section.collapsed {
    max-height: 0;
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.form-card {
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-colour);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--primary-colour);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.message-box {
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    text-align: center;
}

.message-success { background-color: var(--success-bg); color: var(--success-text); }
.message-error { background-color: var(--error-bg); color: var(--error-text); }

/* Code Block */
.code-block {
    background-color: #1f2937;
    color: #e5e7eb;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9rem;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.json-key { color: #93c5fd; }
.json-string { color: #86efac; }
.json-number { color: #fca5a5; }

/* Trust Badges */
.trust-points {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.trust-badge {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 999px;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-colour);
    padding: 2rem 0;
    background: var(--card-bg);
}

.site-footer nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.875rem;
    transition: color var(--transition);
}

.site-footer nav a:hover {
    color: var(--text-main);
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 2rem; }
    .button-group { flex-direction: column; width: 100%; }
    .button-group .btn { width: 100%; text-align: center; }
    .trust-points { gap: 1rem; }
}

.form-group-checkbox {
    margin-bottom: 1.25rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    accent-color: var(--primary-colour);
}