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

:root {
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-text: #1a1a1a;
    --color-text-muted: #666;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-border: #e2e2e2;
    --color-error: #dc2626;
    --color-success: #16a34a;
    --radius: 6px;
    --max-width: 960px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

/* === Header / Nav === */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0 1.5rem;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.site-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-text);
}
.site-brand:hover {
    text-decoration: none;
}

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

.nav-user {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.nav-logout-form {
    display: inline;
}

.nav-link-button {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font: inherit;
    font-size: 0.95rem;
    padding: 0;
}
.nav-link-button:hover {
    text-decoration: underline;
}

/* === Main Content === */
.main-content {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

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

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.btn-primary:hover {
    background: var(--color-primary-hover);
    text-decoration: none;
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-primary);
}
.btn-secondary:hover {
    background: #f0f4ff;
    text-decoration: none;
}

.btn-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1.05rem;
}

/* === Auth Pages === */
.auth-container {
    max-width: 420px;
    margin: 1rem auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
}

.auth-container h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.auth-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* === Forms === */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font: inherit;
    font-size: 0.95rem;
    transition: border-color 0.15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.form-check-input {
    width: 1rem;
    height: 1rem;
}

button[type="submit"].btn-primary {
    width: 100%;
    margin-top: 0.5rem;
}

/* === Validation === */
.validation-summary {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--color-error);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.validation-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.field-validation-error {
    color: var(--color-error);
    font-size: 0.85rem;
}

.status-success {
    color: var(--color-success);
    font-weight: 500;
}
.status-error {
    color: var(--color-error);
    font-weight: 500;
}

/* === Home Page === */
.hero {
    text-align: center;
    padding: 2rem 0 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero-tagline {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.hero p {
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.how-it-works {
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
}

.how-it-works h2 {
    text-align: center;
    margin-bottom: 2rem;
}

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

.step {
    text-align: center;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.step h3 {
    margin-bottom: 0.5rem;
}

.step p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ========== Upload Page ========== */

.upload-dropzone {
    border: 2px dashed #555;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.upload-dropzone:hover {
    border-color: #7c3aed;
}

.dropzone-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.dropzone-icon {
    font-size: 2.5rem;
}

.dropzone-text {
    font-size: 1.1rem;
    font-weight: 600;
}

.dropzone-hint {
    font-size: 0.85rem;
    color: #888;
}

#file-input {
    display: none;
}

.file-info {
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #1a1a2e;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Progress bar */
.progress-bar-container {
    background: #333;
    border-radius: 6px;
    height: 24px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-bar {
    background: #7c3aed;
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 6px;
}

.progress-text {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

/* Processing spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

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

.processing-text {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.processing-hint {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
}

/* ========== Order Table ========== */

.order-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
}

.order-table th,
.order-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.order-table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #888;
}

/* ========== Pricing Table ========== */

.pricing-table {
    width: 100%;
    max-width: 400px;
    border-collapse: collapse;
    margin: 16px 0 24px;
}

.pricing-table td {
    padding: 8px 0;
}

.pricing-table .total-row td {
    border-top: 2px solid #555;
    padding-top: 12px;
    font-size: 1.1rem;
}

.pricing-table .minimum-row td {
    color: #f59e0b;
    font-style: italic;
}

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

/* ========== Badges ========== */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-info {
    background: #1e40af;
    color: #93c5fd;
}

.badge-warning {
    background: #92400e;
    color: #fcd34d;
}

.badge-draft {
    background: #374151;
    color: #9ca3af;
}

.badge-confirmed {
    background: #065f46;
    color: #6ee7b7;
}

.badge-paid {
    background: #1e40af;
    color: #93c5fd;
}

.badge-error {
    background: #7f1d1d;
    color: #fca5a5;
}

.badge-cancelled {
    background: #374151;
    color: #9ca3af;
}

/* ========== Page Layout Helpers ========== */

.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px;
}

.page-description {
    color: #aaa;
    margin-bottom: 24px;
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.order-id {
    color: #888;
    font-family: monospace;
    margin-bottom: 24px;
}

.dfc-note {
    color: #fcd34d;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.order-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ========== Alert ========== */

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-danger {
    background: #7f1d1d;
    color: #fca5a5;
    border: 1px solid #991b1b;
}

/* ========== Buttons (supplements existing) ========== */

.btn-outline {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-outline:hover {
    border-color: #888;
    color: #fff;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}