/* QuoteCheck — Design System */

:root {
    /* Colors */
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #dbeafe;
    
    --color-success: #059669;
    --color-success-light: #d1fae5;
    --color-warning: #d97706;
    --color-warning-light: #fef3c7;
    --color-danger: #dc2626;
    --color-danger-light: #fee2e2;
    
    --color-text: #1f2937;
    --color-text-muted: #6b7280;
    --color-text-light: #9ca3af;
    
    --color-bg: #f9fafb;
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
    --color-border-dark: #d1d5db;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, monospace;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 50px;
}

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

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
}

/* App Container */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    text-align: center;
    padding: var(--space-xl) var(--space-lg) var(--space-lg);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: 1.75rem;
    font-weight: 700;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
}

.tagline {
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
    font-size: 0.95rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: var(--space-lg);
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.section-desc {
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--color-border-dark);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--color-surface);
}

.upload-zone:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.upload-zone.dragover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.upload-link {
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
}

.upload-formats {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: var(--space-sm);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: var(--space-xl) 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.divider span {
    padding: 0 var(--space-md);
}

/* Form */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--color-border-dark);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    background: var(--color-surface);
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.input-with-prefix {
    position: relative;
}

.input-with-prefix .prefix {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

.input-with-prefix input {
    padding-left: calc(var(--space-md) + 1rem);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
}

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

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

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border-dark);
}

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

.btn-back {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
}

.btn-back:hover {
    text-decoration: underline;
}

/* Analysis Section */
.analysis-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.analysis-header h2 {
    margin-bottom: 0;
}

/* Quote Summary */
.quote-summary {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.quote-meta {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.quote-type,
.quote-location {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

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

.quote-total .label {
    color: var(--color-text-muted);
}

.quote-total .amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Fairness Card */
.fairness-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.fairness-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.fairness-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.score-badge {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
}

.score-badge.low {
    background: var(--color-success-light);
    color: var(--color-success);
}

.score-badge.fair {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.score-badge.high {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.score-badge.very-high {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

/* Range Bar */
.fairness-range {
    margin-bottom: var(--space-lg);
}

.range-bar {
    position: relative;
    height: 12px;
    background: linear-gradient(to right, 
        var(--color-success-light) 0%,
        var(--color-primary-light) 50%,
        var(--color-warning-light) 75%,
        var(--color-danger-light) 100%
    );
    border-radius: var(--radius-full);
    margin-bottom: var(--space-sm);
}

.range-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: transparent;
    border-radius: var(--radius-full);
}

.range-marker {
    position: absolute;
    top: -4px;
    width: 20px;
    height: 20px;
    background: var(--color-text);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    transform: translateX(-50%);
    transition: left 0.5s ease;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.fairness-explanation {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Analysis Cards */
.analysis-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.analysis-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

/* Line Items */
.line-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.line-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.line-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.line-item-info {
    flex: 1;
}

.line-item-name {
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.line-item-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.line-item-price {
    font-weight: 600;
    font-family: var(--font-mono);
}

.line-item-status {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
    font-size: 0.8rem;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.line-item-status.fair {
    background: var(--color-success-light);
    color: var(--color-success);
}

.line-item-status.high {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.line-item-status.low {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* Red Flags */
.red-flags {
    list-style: none;
}

.red-flags li {
    padding: var(--space-md);
    background: var(--color-warning-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    font-size: 0.95rem;
    border-left: 3px solid var(--color-warning);
}

.red-flags li:last-child {
    margin-bottom: 0;
}

/* Questions */
.questions {
    list-style: none;
}

.questions li {
    position: relative;
    padding: var(--space-sm) 0 var(--space-sm) var(--space-xl);
    font-size: 0.95rem;
}

.questions li::before {
    content: '?';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Tips */
.tips {
    list-style: none;
}

.tips li {
    position: relative;
    padding: var(--space-sm) 0 var(--space-sm) var(--space-xl);
    font-size: 0.95rem;
}

.tips li::before {
    content: '💡';
    position: absolute;
    left: 0;
}

/* Actions */
.actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: var(--space-lg);
    color: var(--color-text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.app-footer .disclaimer {
    font-size: 0.8rem;
    margin-top: var(--space-xs);
    color: var(--color-text-light);
}

/* Responsive */
@media (max-width: 480px) {
    .main-content {
        padding: var(--space-md);
    }
    
    .upload-zone {
        padding: var(--space-xl) var(--space-md);
    }
    
    .quote-total .amount {
        font-size: 1.5rem;
    }
}
