:root {
    /* Primary: Off-white to light gray gradient for subtle depth */
    --primary-gradient-start: #FAF9F7;
    --primary-gradient-end: #F5F3F0;
    /* Accent: Dutch Orange */
    --accent: #FF8C42;
    --accent-hover: #FF6B35;
    --accent-light: #FFF4ED;
    --accent-lighter: #FFF9F5;
    /* Neutrals - Warm grays to complement orange */
    --slate-900: #2D2926;
    --slate-800: #3D3936;
    --slate-700: #524E4B;
    --slate-600: #656260;
    --slate-500: #807D7A;
    --slate-400: #9B9896;
    --slate-300: #B8B5B3;
    --slate-200: #D6D4D2;
    --slate-100: #ECEAE8;
    --slate-50: #FAF9F7;
    --white: #FFFFFF;
    /* Background */
    --background: #FAF9F7;
    --surface: #FFFFFF;
    /* Semantic colors */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    /* Text */
    --text-primary: #2D2926;
    --text-secondary: #656260;
    --text-light: #9B9896;
    /* Shadows - warm tone */
    --shadow-color: 255, 140, 66; /* RGB values of orange for warm shadows */
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.12);
    --shadow-strong: rgba(255, 140, 66, 0.15);
    --shadow-heavy: rgba(255, 140, 66, 0.25);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: linear-gradient(180deg, #FAF9F7 0%, #F5F3F0 100%);
    min-height: 100vh;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.faktuurtje-app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Hero Section */
.hero-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.gradient-text {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--slate-800);
    background: var(--slate-800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin-bottom: 3rem;
    font-weight: 400;
    opacity: 0.9;
}

/* Magic Input Container */
.magic-input-container {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 40px var(--shadow-light), 0 0 1px var(--shadow-light);
    margin-bottom: 2.5rem;
}

.magic-input {
    width: 100%;
    border: 2px solid var(--slate-200);
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.125rem;
    resize: none;
    transition: all 0.2s ease;
    background: var(--white);
    color: var(--text-primary);
    min-height: 80px;
}

    .magic-input::placeholder {
        color: var(--text-light);
    }

    .magic-input:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 4px var(--shadow-medium);
    }

.submit-button {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px var(--shadow-strong);
}

    .submit-button:hover:not(:disabled) {
        background: var(--accent-hover);
        transform: translateY(-1px);
        box-shadow: 0 6px 20px var(--shadow-strong);
    }

    .submit-button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        box-shadow: none;
    }

/* Examples Section */
.examples {
    color: var(--text-secondary);
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

    .examples h4 {
        color: var(--slate-300);
        font-weight: 500;
        margin-bottom: 1rem;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .examples ul {
        list-style: none;
        padding: 0;
    }

    .examples li {
        background: var(--white);
        border: 1px solid var(--slate-200);
        color: var(--text-primary);
        box-shadow: 0 1px 3px var(--shadow-light);
        backdrop-filter: blur(10px);
        padding: 1rem 1.25rem;
        margin: 0.75rem 0;
        border-radius: 10px;
        font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
        font-size: 0.95rem;
        transition: all 0.2s ease;
        cursor: pointer;
    }

        .examples li:hover {
            background: rgba(255, 255, 255, 0.12);
            transform: translateX(4px);
            border-color: rgba(255, 255, 255, 0.2);
        }

/* Invoice Preview Container */
.invoice-preview-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Actions */
.page-actions {
    margin-bottom: 1.5rem;
}

/* Invoice Paper */
.invoice-paper {
    background: var(--white);
    padding: 4rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-light);
    margin: 2rem 0;
}

/* Invoice Header */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--slate-200);
}

.invoice-title h1 {
    margin: 0;
    color: var(--slate-900);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.invoice-logo {
    max-height: 60px;
    max-width: 180px;
}

.lines-table-mobile {
    display: block;
}

/* Invoice Parties */
.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 3rem 0;
}

.sender, .recipient {
    font-size: 0.95rem;
}

    .sender h3, .recipient h3 {
        color: var(--text-secondary);
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin: 0 0 1rem 0;
    }

    .sender p, .recipient p {
        margin: 0.35rem 0;
        color: var(--text-primary);
        line-height: 1.5;
    }

/* Invoice Details */
.invoice-details {
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--slate-200);
    border-bottom: 1px solid var(--slate-200);
}

    .invoice-details table {
        width: 100%;
        border-collapse: collapse;
    }

    .invoice-details td {
        padding: 0.5rem 0;
        vertical-align: middle;
    }

        .invoice-details td:first-child {
            width: 150px;
            color: var(--text-secondary);
            font-weight: 500;
        }

/* Invoice Lines Table */
.invoice-lines {
    margin: 2rem 0;
    overflow-x:auto;
}

.lines-table {
    width: 100%;
    border-collapse: collapse;
    overflow-x:auto;
}

    .lines-table thead {
        background: var(--slate-50);
    }

    .lines-table th {
        text-align: left;
        padding: 0.75rem;
        border-bottom: 2px solid var(--slate-300);
        color: var(--text-secondary);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

        .lines-table th:nth-child(2) {
            width: 180px;
        }

        .lines-table th:nth-child(3) {
            width: 120px;
        }

        .lines-table th:nth-child(4) {
            width: 100px;
            text-align: right;
        }

        .lines-table th:nth-child(5) {
            width: 50px;
            text-align: center;
        }

    .lines-table tbody tr {
        border-bottom: 1px solid var(--slate-100);
    }

        .lines-table tbody tr:hover {
            background: var(--slate-50);
        }

    .lines-table td {
        padding: 0.75rem;
        vertical-align: middle;
    }

        .lines-table td:nth-child(4) {
            text-align: right;
            font-weight: 500;
        }

        .lines-table td:nth-child(5) {
            text-align: center;
        }

/* Editable Fields */
.editable-field {
    background: transparent;
    border: 1px solid transparent;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    width: 100%;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

    .editable-field:hover {
        background: var(--accent-lighter);
        border-color: var(--slate-200);
    }

    .editable-field:focus {
        outline: none;
        background: white;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--shadow-medium);
    }

.editable-field-inline {
    display: inline-block;
    width: auto;
    min-width: 60px;
}

.field-required {
    border-color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.05);
}

    .field-required:focus {
        border-color: var(--danger) !important;
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
    }

/* Button to Add Line */
.btn-add-line {
    background: var(--slate-50);
    border: 2px dashed var(--slate-300);
    color: var(--text-secondary);
    padding: 0.75rem;
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .btn-add-line:hover {
        background: var(--accent-lighter);
        border-color: var(--accent);
        color: var(--accent);
    }

/* Remove Line Button */
.btn-remove-line {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1.5rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

    .btn-remove-line:hover {
        opacity: 1;
    }

/* Invoice Totals */
.invoice-totals {
    display: flex;
    justify-content: flex-end;
    margin: 3rem 0 2rem 0;
}

    .invoice-totals table {
        width: 350px;
        border-collapse: collapse;
    }

    .invoice-totals td {
        padding: 0.5rem;
        vertical-align: middle;
    }

        .invoice-totals td:first-child {
            text-align: left;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .invoice-totals td:last-child {
            text-align: right;
            font-weight: 600;
            color: var(--text-primary);
        }

.total-row {
    font-size: 1.25rem;
}

    .total-row td {
        border-top: 3px solid var(--slate-900);
        padding-top: 1rem;
        font-weight: 700;
        color: var(--slate-900);
    }

/* Payment Section */
.invoice-payment {
    background: var(--slate-50);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 2rem 0;
}

    .invoice-payment p {
        margin: 0.5rem 0;
        color: var(--text-primary);
    }

        .invoice-payment p:first-child {
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 1rem;
        }

/* QR Code Section */
.invoice-qr {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background: var(--slate-50);
    border-radius: 12px;
}

    .invoice-qr img {
        width: 150px;
        height: 150px;
        padding: 1rem;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .invoice-qr p {
        margin-top: 1rem;
        color: var(--text-secondary);
        font-size: 0.875rem;
    }

/* Invoice Footer */
.invoice-footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--slate-200);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

    .invoice-footer a {
        color: var(--accent);
        text-decoration: none;
        font-weight: 500;
    }

        .invoice-footer a:hover {
            text-decoration: underline;
        }

/* Invoice Actions */
.invoice-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 14px var(--shadow-strong);
}

    .btn-primary:hover:not(:disabled) {
        background: var(--accent-hover);
        transform: translateY(-1px);
        box-shadow: 0 6px 20px var(--shadow-heavy);
    }

.btn-secondary {
    background: var(--slate-100);
    color: var(--text-primary);
}

    .btn-secondary:hover:not(:disabled) {
        background: var(--slate-200);
    }

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--slate-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--white);
}

    .form-control:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--shadow-medium);
    }

/* Validation Messages */
.validation-message {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Validation Warning Banner */
.validation-warning {
    background: #FEF3C7;
    border: 2px solid #F59E0B;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #92400E;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Validation Modal */
.validation-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.validation-modal {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px var(--shadow-strong);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.validation-header {
    margin-bottom: 1.5rem;
}

.validation-header h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.progress-bar {
    height: 8px;
    background: var(--slate-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2rem;
}

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

/* Validation Modal Question Options */
.options {
    display: grid;
    gap: 0.75rem;
}

.option-button {
    padding: 1rem 1.25rem;
    border: 2px solid var(--slate-200);
    background: var(--white);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    color: var(--text-primary);
    text-align: left;
    font-weight: 500;
    font-family: inherit;
    width: 100%;
    display: block;
}

    .option-button:hover {
        background: var(--accent-lighter);
        border-color: var(--accent);
        transform: translateX(2px);
        box-shadow: 0 2px 8px var(--shadow-medium);
    }

    .option-button:active {
        transform: translateX(0);
    }

    .option-button.selected {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    }

/* For text input options in validation modal */
.option-input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--slate-200);
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
    transition: all 0.2s ease;
    background: var(--white);
    font-family: inherit;
    color: var(--text-primary);
}

    .option-input:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--shadow-medium);
    }

    .option-input::placeholder {
        color: var(--text-light);
    }

/* Question Actions Buttons */
.question-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

    .question-actions .btn {
        flex: 1;
    }

/* Skip button style */
.btn-skip {
    background: var(--slate-100);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

    .btn-skip:hover {
        background: var(--slate-200);
        color: var(--text-primary);
    }

/* Confirm/Next button */
.btn-confirm {
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

    .btn-confirm:hover {
        background: var(--accent-hover);
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
    }

    .btn-confirm:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

/* Confidence Indicators */
.confidence-indicator {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.confidence-high {
    background: #D1FAE5;
    color: #065F46;
}

.confidence-medium {
    background: #FEF3C7;
    color: #92400E;
}

.confidence-low {
    background: #FEE2E2;
    color: #991B1B;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gradient-text {
        font-size: 2.5rem;
    }

    .invoice-paper {
        padding: 2rem 1.5rem;
    }

    .invoice-parties {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .faktuurtje-app {
        padding: 1rem;
    }

    .invoice-totals table {
        width: 100%;
    }
}

/* Spinner */
.spinner {
    border: 4px solid var(--slate-200);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 700ms linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

@media (max-width: 480px) {
    .invoice-paper {
        padding: 1.5rem 1rem;
    }

    .lines-table {
        font-size: 0.875rem;
    }

        .lines-table th,
        .lines-table td {
            padding: 0.5rem 0.25rem;
        }
}

/* Pricing Table */
.pricing-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-light);
}

    .pricing-table thead {
        background: var(--slate-100);
    }

    .pricing-table th {
        padding: 1rem;
        text-align: left;
        color: var(--text-secondary);
        font-weight: 600;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        border-bottom: 2px solid var(--slate-200);
    }

    .pricing-table td {
        padding: 1rem;
        color: var(--text-primary);
        border-bottom: 1px solid var(--slate-100);
    }

    .pricing-table tbody tr {
        transition: background 0.2s ease;
    }

        .pricing-table tbody tr:hover {
            background: var(--accent-lighter);
        }

        .pricing-table tbody tr.highlighted {
            background: var(--accent-lighter);
            border-left: 4px solid var(--accent);
        }

            .pricing-table tbody tr.highlighted:hover {
                background: var(--accent-light);
            }

.badge-popular {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.features-summary {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--slate-50);
    border-radius: 8px;
}

@media (max-width: 640px) {
    .pricing-table {
        font-size: 0.875rem;
    }

        .pricing-table th,
        .pricing-table td {
            padding: 0.75rem 0.5rem;
        }

    .badge-popular {
        display: block;
        margin: 0.25rem 0 0 0;
        width: fit-content;
    }
}
