/* MapForge Design System — Light Theme */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f8f7f4;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --border: #e5e5e5;
    --border-hover: #d4d4d4;
    --border-active: #a3a3a3;
    --text: #1a1a1a;
    --text-muted: #525252;
    --text-dim: #737373;
    --text-faint: #a3a3a3;
    --accent: #d97706;
    --accent-hover: #b45309;
    --accent-glow: rgba(217,119,6,0.2);
    --accent-subtle: rgba(217,119,6,0.08);
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;
    --font-body: 'DM Sans', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
}

.grain {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 100;
}

.accent { color: var(--accent); }

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
    color: #1a1a1a;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.logo span { color: var(--accent); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover { color: #1a1a1a; }

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #ffffff;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.05rem;
    width: 100%;
    justify-content: center;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--text);
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid var(--border-hover);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.btn-secondary:hover {
    border-color: var(--border-active);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.btn-ghost:hover {
    background: rgba(0,0,0,0.04);
    color: #1a1a1a;
}

/* Forms */
.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.section-badge {
    position: absolute;
    top: -10px;
    left: 1.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    background: var(--bg);
    padding: 0 0.5rem;
    font-weight: 600;
}

.form-section h2 {
    font-size: 1.25rem;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: #f5f5f4;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    color: #1a1a1a;
    font-size: 0.95rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(217,119,6,0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-faint);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23737373' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    background-color: #f5f5f4;
}

.form-group select option {
    background: #ffffff;
    color: #1a1a1a;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.char-count {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.35rem;
    text-align: right;
}

/* Audit Page */
.audit-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem;
}

.audit-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.audit-header h1 {
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    letter-spacing: -1px;
}

.audit-header p {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.6;
}

.audit-form .btn-primary {
    margin-top: 0.5rem;
}

/* Results Page */
.results-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
}

.results-header {
    text-align: center;
    margin-bottom: 3rem;
}

.results-header h1 {
    font-size: 1.8rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.results-header .business-name {
    color: var(--accent);
}

/* Loading state */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-state .spinner-lg {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem;
}

.loading-state .spinner-lg circle {
    stroke: var(--accent);
}

.loading-state h2 {
    font-size: 1.3rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.loading-state p {
    color: var(--text-dim);
}

/* Score Circle */
.score-section {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.score-circle {
    position: relative;
    width: 180px;
    height: 180px;
}

.score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-circle .bg-ring {
    fill: none;
    stroke: #e5e5e5;
    stroke-width: 8;
}

.score-circle .score-ring {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s ease, stroke 0.5s;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value .number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
}

.score-value .label {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

/* Summary Card */
.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.summary-card p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 1rem;
}

/* Quick Wins */
.quick-wins {
    margin-bottom: 2rem;
}

.quick-wins h2 {
    font-size: 1.2rem;
    color: #1a1a1a;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-win-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-win-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(217,119,6,0.06);
    border: 1px solid rgba(217,119,6,0.15);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.quick-win-item .icon {
    color: var(--accent);
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.quick-win-item p {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Audit Items Grid */
.audit-items-section h2 {
    font-size: 1.2rem;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.audit-items-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.audit-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.audit-item:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.audit-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.audit-item-header h3 {
    font-size: 1rem;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-weight: 600;
}

.status-good { background: rgba(22,163,74,0.08); color: #16a34a; border: 1px solid rgba(22,163,74,0.2); }
.status-warning { background: rgba(217,119,6,0.08); color: #d97706; border: 1px solid rgba(217,119,6,0.2); }
.status-critical { background: rgba(220,38,38,0.08); color: #dc2626; border: 1px solid rgba(220,38,38,0.2); }
.status-missing { background: rgba(115,115,115,0.08); color: #737373; border: 1px solid rgba(115,115,115,0.2); }

.audit-item-score {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
}

.score-good { color: var(--success); }
.score-warning { color: var(--warning); }
.score-critical { color: var(--danger); }

.score-bar {
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s ease;
}

.audit-item-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.detail-block label {
    display: block;
    color: var(--text-faint);
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-block p {
    color: var(--text-muted);
    line-height: 1.5;
}

.audit-item-recommendation {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
}

.audit-item-recommendation strong {
    color: var(--accent);
}

/* Optimized Description Section */
.optimized-section {
    margin-top: 2rem;
}

.optimized-section h2 {
    font-size: 1.2rem;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.optimized-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.optimized-card h3 {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.optimized-card p,
.optimized-card .desc-text {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid rgba(217,119,6,0.2);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.copy-btn:hover {
    background: rgba(217,119,6,0.12);
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.category-tag {
    background: rgba(217,119,6,0.06);
    border: 1px solid rgba(217,119,6,0.2);
    color: var(--accent);
    padding: 0.35rem 0.75rem;
    border-radius: 100px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.category-tag:hover {
    background: rgba(217,119,6,0.12);
}

.category-tag:first-child {
    background: rgba(217,119,6,0.12);
    font-weight: 600;
}

/* Recommendations */
.recommendations-section {
    margin-top: 2rem;
}

.recommendations-section h2 {
    font-size: 1.2rem;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.recommendation-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.recommendation-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.recommendation-card h3 {
    font-size: 0.95rem;
    color: #1a1a1a;
}

.impact-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-weight: 600;
}

.impact-high { background: rgba(22,163,74,0.08); color: #16a34a; }
.impact-medium { background: rgba(217,119,6,0.08); color: #d97706; }
.impact-low { background: rgba(115,115,115,0.08); color: #737373; }

.recommendation-card p {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.5;
}

.recommendation-meta {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-faint);
}

/* Dashboard */
.dashboard-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    color: #1a1a1a;
}

.audit-history {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.audit-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.audit-history-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.audit-history-item .audit-info h3 {
    font-size: 1rem;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.audit-history-item .audit-info p {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.audit-history-item .audit-score {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state h2 {
    font-size: 1.3rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}

/* Login Page */
.login-page {
    max-width: 420px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.8rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-dim);
}

.login-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.login-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.login-tab {
    flex: 1;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    color: var(--text-dim);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.login-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.login-form .btn-primary {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}

.login-form .form-group {
    margin-bottom: 1rem;
}

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.form-divider {
    text-align: center;
    color: var(--text-faint);
    font-size: 0.85rem;
    margin: 1rem 0;
}

/* Spinner */
.spinner {
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    nav { padding: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .audit-item-details { grid-template-columns: 1fr; }
    .audit-page { padding: 1rem; }
    .results-page { padding: 1rem; }
    .dashboard-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .nav-links { gap: 1rem; }
}
