:root {
    --primary: #16a34a;
    /* Green 600 */
    --primary-hover: #15803d;
    /* Green 700 */
    --bg: #fafaf9;
    /* Stone 50 (Off-white) */
    --card-bg: #ffffff;
    --text-main: #1c1917;
    /* Stone 900 */
    --text-muted: #57534e;
    /* Stone 500 */
    --border: #e7e5e4;
    /* Stone 200 */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.7;
    /* Slightly increased for better readability */
    padding: 2rem 1rem;
}

/* Global Link Styling */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s, border-bottom-color 0.2s;
    border-bottom: 1px solid transparent;
}

a:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-hover);
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* Typography for Legal Pages & Content */
h1,
h2,
h3,
h4 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.3;
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
}

h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

p,
li {
    margin-bottom: 0.75rem;
}

ul,
ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

li::marker {
    color: var(--primary);
}

/* Header Specifics */
header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    color: var(--text-main);
    /* Override primary color for title for cleaner look */
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Card Styling */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    /* Softer corners */
    padding: 2.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.input-group {
    display: flex;
    gap: 0.75rem;
}

input[type="text"],
select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    /* Thinner border */
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: inherit;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
    /* Green glow */
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0 2rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

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

    .btn-primary {
        width: 100%;
        padding: 0.875rem;
    }

    .card {
        padding: 1.5rem;
    }
}

.formula-box {
    background: #f3f4f6;
    /* Cool gray 100 */
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    margin-top: 1rem;
    position: relative;
}

.formula-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.btn-sm {
    background: white;
    border: 1px solid var(--border);
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-main);
    transition: all 0.2s;
    font-weight: 500;
}

.btn-sm:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0fdf4;
    /* Light green bg */
}

code {
    display: block;
    font-family: 'ui-monospace', 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', monospace;
    word-break: break-all;
    color: var(--text-main);
    font-size: 0.9rem;
}

.hint {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Results Styling */
.result-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow);
}

.result-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.result-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-main);
}

.status-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-active {
    background: #dcfce7;
    color: #15803d;
}

.status-inactive {
    background: #fee2e2;
    color: #b91c1c;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.result-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-item span {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.1rem;
}

.error-msg {
    background: #fef2f2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    border: 1px solid #fecaca;
}

.loading-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

footer {
    text-align: center;
    margin-top: 5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 0.75rem;
    transition: color 0.2s;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Content Sections */
.content-section {
    margin-top: 3rem;
}

.steps-list {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    counter-reset: steps;
    list-style: none;
}

.steps-list li {
    margin-bottom: 1rem;
    color: var(--text-main);
    position: relative;
    padding-left: 1rem;
}

.steps-list li::before {
    counter-increment: steps;
    content: counter(steps);
    position: absolute;
    left: -1.5rem;
    top: 0.1rem;
    background: var(--primary);
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    text-align: center;
    line-height: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

article {
    margin-bottom: 2.5rem;
}

article:last-child {
    margin-bottom: 0;
}

article h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

details {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    background: #fff;
    transition: all 0.2s;
}

details[open] {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
    list-style: none;
    position: relative;
    padding-right: 2rem;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    position: absolute;
    right: 0;
    font-weight: bold;
    color: var(--primary);
    font-size: 1.25rem;
    line-height: 1;
}

details[open] summary::after {
    content: '-';
}

details p {
    margin-top: 1rem;
    color: var(--text-muted);
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Contact Email Highlight */
.contact-email {
    background: #f0fdf4;
    color: var(--primary);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.25rem;
    margin: 1.5rem 0;
    border: 1px dashed var(--primary);
}