/* Invoice Extractor - Nordic Warmth Theme */
/* Inspired by Norwegian mountain lodges: warm amber glow, soft mist, inviting simplicity */

:root {
    /* Warm accent colors */
    --primary: #d97706;
    --primary-hover: #b45309;
    --primary-light: #fef3c7;
    --primary-glow: rgba(217, 119, 6, 0.15);

    /* Status colors */
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --error: #dc2626;
    --error-light: #fee2e2;

    /* Light, warm palette */
    --bg: #faf9f7;
    --bg-warm: #f5f3ef;
    --card-bg: #ffffff;
    --card-hover: #fefdfb;

    /* Text colors */
    --text: #1c1917;
    --text-secondary: #57534e;
    --text-muted: #a8a29e;

    /* Borders */
    --border: #e7e5e4;
    --border-light: #f5f5f4;

    /* Radius - softer corners */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;

    /* Shadows - soft and warm */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 4px 20px rgba(217, 119, 6, 0.2);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-warm) 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Top Navigation Bar */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
}

.nav-icon {
    font-size: 1.5rem;
    background: var(--primary-light);
    padding: 0.375rem;
    border-radius: 8px;
}

.nav-title {
    color: var(--text);
}

.btn-nav {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
}

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

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

/* Wider layout for results page */
.results-card {
    max-width: none;
}

@media (min-width: 1024px) {
    .container:has(.results-card) {
        max-width: 80%;
    }
}

/* Header - friendly and clear */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-muted);
    margin-top: 0.375rem;
    font-size: 0.95rem;
}

/* Cards - clean and elevated */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.25rem;
}

.hidden {
    display: none !important;
}

/* Form Styles - spacious and clear */
.form-section {
    margin-bottom: 2rem;
}

.form-section:last-of-type {
    margin-bottom: 1.5rem;
}

.form-section h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Section icons */
.form-section h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

.form-row {
    display: flex;
    gap: 0.875rem;
}

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

.form-group-small {
    flex: 0 0 100px;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--text);
    transition: all 0.2s ease;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:hover,
.form-group select:hover {
    border-color: #d6d3d1;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%2378716c' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
}

.form-group small {
    display: block;
    margin-top: 0.375rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-group small a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.form-group small a:hover {
    text-decoration: underline;
}

/* Month Grid - playful and clear */
.month-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.month-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 0.375rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.month-checkbox:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.month-checkbox input {
    display: none;
}

.month-checkbox input:checked + span {
    color: var(--primary);
    font-weight: 600;
}

.month-checkbox:has(input:checked) {
    background: var(--primary-light);
    border-color: var(--primary);
}

.month-actions {
    display: flex;
    gap: 0.5rem;
}

.month-actions button {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.month-actions button:hover {
    background: var(--bg);
    color: var(--text);
}

/* Toggle Option - friendly checkbox */
.toggle-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    transition: all 0.15s;
}

.toggle-option:hover {
    border-color: #d6d3d1;
}

.toggle-option input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.toggle-label {
    font-weight: 500;
    color: var(--text);
    font-size: 0.95rem;
}

/* Buttons - warm and inviting */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(217, 119, 6, 0.3);
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    background: var(--card-bg);
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

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

.action-buttons {
    display: flex;
    gap: 0.875rem;
    margin-top: 1.5rem;
}

.action-buttons .btn-primary {
    width: auto;
    flex: 1;
}

/* Progress Section - clear feedback */

/* Processing Header with Spinner */
.processing-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.processing-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

.processing-info h2 {
    margin: 0;
    font-size: 1.25rem;
}

.processing-info h2::before {
    display: none;
}

.processing-status {
    margin: 0.25rem 0 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.processing-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-warm);
    border-radius: var(--radius-sm);
    font-style: italic;
    transition: opacity 0.3s ease;
}

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

/* Error State */
.processing-spinner.error {
    border-color: var(--error-light);
    border-top-color: var(--error);
    animation: none;
}

.error-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.error-hint {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.error-actions .btn-primary {
    width: auto;
    display: inline-flex;
    padding: 0.875rem 2rem;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #f59e0b);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-weight: 700;
    min-width: 48px;
    text-align: right;
    color: var(--primary);
    font-size: 0.95rem;
}

.phase-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.phase {
    padding: 0.5rem 1rem;
    background: var(--bg);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.phase.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.phase-arrow {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Log Container - friendly terminal */
.log-container {
    background: #1e1e1e;
    border-radius: var(--radius-sm);
    padding: 1rem;
    max-height: 280px;
    overflow-y: auto;
    font-family: 'SF Mono', 'Fira Code', Monaco, monospace;
}

.log-container::-webkit-scrollbar {
    width: 6px;
}

.log-container::-webkit-scrollbar-track {
    background: transparent;
}

.log-container::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.log-entry {
    font-size: 0.8rem;
    padding: 0.25rem 0;
    color: #a3a3a3;
    line-height: 1.5;
}

.log-info { color: #a3a3a3; }
.log-success { color: #4ade80; }
.log-warning { color: #fbbf24; }
.log-error { color: #f87171; }
.log-phase { color: #fbbf24; font-weight: 600; }

/* Results Section - New Design */
.results-card {
    text-align: center;
}

.results-success-header {
    margin-bottom: 2rem;
}

.success-icon {
    width: 56px;
    height: 56px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
}

.results-success-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.results-success-header h2::before {
    display: none;
}

.results-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

/* Search parameters display */
.search-params {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-warm);
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    font-size: 0.875rem;
}

.param-item {
    display: inline-flex;
    gap: 0.35rem;
}

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

.param-value {
    color: var(--text);
    font-weight: 500;
}

.param-separator {
    color: var(--border);
}

/* Results Details - Two columns */
.results-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
    text-align: left;
}

.results-column h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}

/* Provider Breakdown with checkboxes */
.provider-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.provider-breakdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}

.provider-breakdown-item:hover {
    background: var(--bg-warm);
}

.provider-breakdown-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.provider-initial {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.provider-info {
    flex: 1;
}

.provider-info .provider-name {
    font-weight: 500;
    color: var(--text);
}

.provider-stats {
    text-align: right;
}

.provider-stats .provider-count {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.provider-stats .provider-amount {
    font-weight: 600;
    color: var(--text);
}

/* Findings */
.findings-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.finding-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
}

.finding-warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
}

.finding-info {
    background: #e0e7ff;
    border: 1px solid #a5b4fc;
}

.finding-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.finding-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.finding-content strong {
    color: var(--text);
}

.finding-content span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.no-findings {
    color: var(--text-muted);
    font-style: italic;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin: 0;
}

/* Summary Grid - Updated with icons */
.summary-item .summary-icon {
    display: block;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.summary-item .summary-icon svg {
    width: 28px;
    height: 28px;
}

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

    .results-success-header h2 {
        font-size: 1.5rem;
    }
}

/* Legacy Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.results-header h2::before {
    display: none;
}

.results-section {
    margin-bottom: 1.5rem;
}

.results-section h3 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.875rem;
    color: var(--text-muted);
}

/* Summary Grid - celebratory */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
}

.summary-item {
    text-align: center;
    padding: 1.25rem 1rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff7ed 100%);
    border: 1px solid #fed7aa;
    border-radius: var(--radius-sm);
}

.summary-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Provider List */
.provider-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.provider-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
}

.provider-item:last-child {
    border-bottom: none;
}

.provider-item:hover {
    background: var(--bg);
}

.provider-name {
    font-weight: 500;
    color: var(--text);
}

.provider-count {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.provider-amount {
    font-weight: 600;
    color: var(--success);
}

/* Findings List */
.findings-list {
    list-style: none;
}

.findings-list li {
    padding: 0.875rem 1rem;
    background: var(--warning-light);
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #92400e;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.results-table th,
.results-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.results-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.results-table tr:hover td {
    background: var(--bg);
}

.results-table td.amount {
    text-align: right;
    font-family: 'SF Mono', Monaco, monospace;
    font-weight: 500;
    color: var(--success);
}

/* Error Page */
.error-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.error-message {
    color: var(--error);
    margin: 1rem 0;
    font-size: 1rem;
}

.error-card .btn-primary {
    width: auto;
    display: inline-flex;
    padding: 0.875rem 2rem;
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1.5rem;
}

/* Provider Selection Grid - large, clear cards */
.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.provider-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 0.875rem;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.provider-card:hover {
    border-color: #d6d3d1;
    background: var(--bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.provider-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-glow);
}

.provider-logo {
    width: 40px;
    height: 40px;
    margin-bottom: 0.5rem;
}

.provider-logo svg {
    width: 100%;
    height: 100%;
}

.provider-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin-bottom: 0.125rem;
}

.provider-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.3;
}

.provider-radio {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.provider-card:hover .provider-radio {
    border-color: #d6d3d1;
}

.provider-card.selected .provider-radio {
    border-color: var(--primary);
    background: var(--primary);
}

.radio-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.15s;
}

.provider-card.selected .radio-dot {
    background: white;
}

/* Ollama Status */
.ollama-status {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    background: var(--success-light);
    border: 1px solid #86efac;
    border-radius: var(--radius-sm);
    color: var(--success);
}

.ollama-status .status-icon {
    font-size: 1rem;
}

.ollama-status .status-text {
    font-weight: 500;
    font-size: 0.9rem;
}

.ollama-status.error {
    background: var(--error-light);
    border-color: #fca5a5;
    color: var(--error);
}

/* Code styling */
code {
    background: var(--bg);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-xs);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.85em;
    color: var(--primary);
}

/* Input with button - clear action */
.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button input {
    flex: 1;
}

.input-with-button button {
    padding: 0.875rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.15s;
}

.input-with-button button:hover {
    background: var(--primary-hover);
}

.input-with-button button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.input-with-button button.loading {
    position: relative;
    color: transparent;
}

.input-with-button button.loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Field error */
.field-error {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 0.375rem;
}

/* Model loading states */
.models-loaded {
    background: var(--success) !important;
}

/* Responsive - mobile-friendly */
@media (max-width: 600px) {
    .top-nav {
        padding: 0.75rem 1rem;
    }

    .nav-title {
        display: none;
    }

    .btn-nav {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .container {
        padding: 1.25rem 1rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: var(--radius-sm);
    }

    header h1 {
        font-size: 1.5rem;
    }

    .month-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .summary-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group-small {
        flex: 1;
    }

    .phase-indicator {
        gap: 0.375rem;
    }

    .phase {
        font-size: 0.7rem;
        padding: 0.375rem 0.75rem;
    }

    .phase-arrow {
        display: none;
    }

    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .provider-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .provider-desc {
        display: none;
    }

    .provider-card {
        padding: 1rem 0.75rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn-primary,
    .action-buttons .btn-secondary {
        width: 100%;
    }

    .input-with-button {
        flex-direction: column;
    }

    .input-with-button button {
        width: 100%;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: var(--primary-light);
    color: var(--text);
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== EMAIL PROVIDER BUTTONS ===== */
.email-provider-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}

.email-provider-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 1rem 0.5rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.email-provider-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.email-provider-btn.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.email-provider-btn .provider-icon {
    font-size: 1.5rem;
}

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

/* ===== WIZARD STYLES ===== */

/* Wizard Progress Indicator */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.wizard-step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.wizard-step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.wizard-step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.wizard-step.completed .step-number::after {
    content: '✓';
    font-size: 1.1rem;
}

.wizard-step.completed .step-number {
    font-size: 0;
}

.wizard-step.completed .step-label {
    color: var(--success);
}

.wizard-connector {
    flex: 1;
    max-width: 80px;
    height: 2px;
    background: var(--border);
    margin: 0 0.5rem;
    margin-bottom: 1.25rem;
    transition: background 0.3s ease;
}

.wizard-connector.completed {
    background: var(--success);
}

/* Wizard Panels */
.wizard-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.wizard-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Step Header */
.step-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.step-header h2 {
    margin-bottom: 0.375rem;
}

.step-header h2::before {
    display: none;
}

.step-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Wizard Navigation */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.wizard-nav .btn-primary,
.wizard-nav .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: auto;
    min-width: 140px;
}

.btn-arrow {
    font-size: 1.1rem;
    transition: transform 0.15s ease;
}

.btn-primary:hover .btn-arrow {
    transform: translateX(3px);
}

.btn-secondary:hover .btn-arrow {
    transform: translateX(-3px);
}

/* Input error state */
input.error,
select.error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Responsive wizard */
@media (max-width: 600px) {
    .wizard-progress {
        margin-bottom: 1rem;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .wizard-connector {
        max-width: 40px;
        margin: 0 0.25rem;
        margin-bottom: 1.25rem;
    }

    .wizard-nav {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .wizard-nav .btn-primary,
    .wizard-nav .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}
