:root {
    --bg-color: #ffffff;
    --surface-color: #f7f7f7;
    --border-color: #e0e0e0;
    --primary-accent: #D32F2F; /* Red */
    --secondary-accent: #B71C1C; /* Dark red */
    --text-main: #1a1a1a; /* Black */
    --text-muted: #555555; /* Dark grey */
    
    --state-yes: #4A7C59; /* Muted green */
    --state-maybe: #C4943A; /* Amber */
    
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'DM Sans', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    background-image: none;
}

.serif { font-family: var(--font-serif); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-amber { color: var(--primary-accent); }
.text-rose { color: var(--secondary-accent); }
.text-sm { font-size: 0.85rem; color: var(--text-muted); }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }
.pb-100 { padding-bottom: 100px; }

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
}
.align-center {
    align-items: center;
}

/* Typography */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.2; }
.logo { font-size: 3rem; color: var(--primary-accent); margin-top: 40px; margin-bottom: 10px; }
.logo-small { font-size: 1.8rem; color: var(--primary-accent); margin: 0; }
.tagline { font-size: 1.1rem; color: var(--text-muted); max-width: 80%; margin: 0 auto 30px; }
.subtext { color: var(--text-muted); font-size: 0.95rem; }

/* Cards & Forms */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.input-group {
    text-align: left;
    margin-bottom: 15px;
}
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
input[type="text"] {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-accent);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
}
.btn-block { width: 100%; }
.btn-primary {
    background: var(--primary-accent);
    color: #ffffff;
}
.btn-primary:hover {
    background: #E53935;
}
.btn-secondary {
    background: #e0e0e0;
    color: #1a1a1a;
}
.btn-secondary:hover {
    background: #d0d0d0;
}

.error-msg {
    color: var(--secondary-accent);
    margin-top: 10px;
    font-size: 0.9rem;
    display: none;
}

/* Header / Footer */
.app-header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 10;
}
.user-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    background: #ffffff;
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.site-footer {
    margin-top: 50px;
    padding: 20px 0;
    font-size: 0.8rem;
    color: #999;
}

/* Checklist / Accordion */
.instruction {
    background: rgba(211, 47, 47, 0.05);
    border: 1px solid rgba(211, 47, 47, 0.15);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.9rem;
    text-align: center;
}
.inline-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    color: #fff;
}
.state-yes { background: var(--state-yes); }
.state-maybe { background: var(--state-maybe); }

.category-accordion {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
}
.category-header {
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-accent);
    list-style: none; /* remove default arrow */
    background: rgba(211, 47, 47, 0.05);
}
.category-header::-webkit-details-marker { display: none; }
.category-header:hover { background: rgba(211, 47, 47, 0.1); }
.cat-count {
    font-size: 1rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-weight: 400;
}
.category-items {
    border-top: 1px solid var(--border-color);
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.item-row:last-child { border-bottom: none; }
.item-info { flex: 1; padding-right: 15px; }
.item-label { font-size: 1rem; color: #1a1a1a; }
.item-desc { font-size: 0.8rem; color: #666666; margin-top: 4px; }

/* 3-State Toggle */
.state-toggle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}
.state-toggle span { display: none; color: #fff; font-weight: bold; font-size: 0.9rem; }

.state-toggle[data-state="empty"] .icon-empty { display: block; }

.state-toggle[data-state="yes"] {
    background: var(--state-yes);
    border-color: var(--state-yes);
}
.state-toggle[data-state="yes"] .icon-yes { display: block; }

.state-toggle[data-state="maybe"] {
    background: var(--state-maybe);
    border-color: var(--state-maybe);
}
.state-toggle[data-state="maybe"] .icon-maybe { display: block; }

/* Sticky Footer */
.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 15px 0;
    z-index: 100;
}
.selection-count {
    font-size: 1rem;
    color: var(--text-muted);
}
.selection-count span {
    color: var(--text-main);
    font-weight: bold;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-card { width: 90%; max-width: 400px; text-align: center; }

/* Loader */
.pulse-loader {
    width: 50px;
    height: 50px;
    background-color: var(--primary-accent);
    border-radius: 100%;
    margin: 0 auto;
    animation: sk-scaleout 1.0s infinite ease-in-out;
}
@keyframes sk-scaleout {
    0% { transform: scale(0); }
    100% { transform: scale(1.0); opacity: 0; }
}

/* Link Share */
.link-box { display: flex; gap: 10px; }
.link-box input { flex: 1; font-size: 0.85rem; color: #777; }
.share-card h3 { font-family: var(--font-sans); font-size: 1.1rem; margin-bottom: 5px; }

/* Results */
.match-number { font-size: 4rem; display: block; margin: -10px 0; }
.match-category {
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.match-cat-title {
    padding: 15px 20px;
    background: rgba(0,0,0,0.02);
    border-bottom: 1px solid var(--border-color);
    font-size: 1.2rem;
}
.match-items { padding: 0 20px; }
.match-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.match-card:last-child { border-bottom: none; }
.match-label { font-size: 1rem; flex: 1; padding-right: 15px; }
.match-strength {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.strength-icon { font-weight: bold; margin-right: 6px; font-size: 0.9rem; }
.badge-yes-yes { background: rgba(74, 124, 89, 0.2); color: #2E7D32; }
.badge-maybe-maybe { background: rgba(196, 148, 58, 0.2); color: #E65100; }
.badge-mixed { background: rgba(0, 0, 0, 0.06); color: #555; }
