﻿/* ============================================================
   InvoiceXML — Create Factur-X Form Styles
   ============================================================ */

/* ----------------------------------------------------------
   1. LIGHT-FORM WRAPPER
   ---------------------------------------------------------- */
.light-form {
    --background: 0 0% 98%;
    --foreground: 220 20% 14%;
    --card: 0 0% 100%;
    --card-foreground: 220 20% 14%;
    --popover: 0 0% 100%;
    --popover-foreground: 220 20% 14%;
    --secondary: 220 14% 94%;
    --secondary-foreground: 220 20% 14%;
    --muted: 220 14% 92%;
    --muted-foreground: 220 10% 46%;
    --accent: 152 56% 32%;
    --accent-foreground: 0 0% 100%;
    --border: 220 13% 86%;
    --input: 220 13% 86%;
    --ring: 152 56% 32%;
    --shadow-card: 0 4px 24px -4px hsl(0 0% 0% / 0.06);
    color: hsl(220 20% 14%);
    border-radius: 1rem;
    background: hsl(var(--background));
    padding: 1.5rem;
    box-shadow: 0 4px 24px -4px hsl(0 0% 0% / 0.12);
}

@media (min-width: 768px) {
    .light-form {
        padding: 2rem;
    }
}

/* ----------------------------------------------------------
   2. FORM CARD
   ---------------------------------------------------------- */
.form-card {
    border-radius: 0.75rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card) / 0.8);
    backdrop-filter: blur(4px);
    box-shadow: var(--shadow-card);
}

.form-card__header {
    padding: 1.25rem 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-card__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.form-card__body {
    padding: 0 1.5rem 1.5rem;
}

/* ----------------------------------------------------------
   3. FORM FIELD
   ---------------------------------------------------------- */
.field {
    margin-bottom: 0;
}

.field__label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.375rem;
    font-weight: 500;
}

.field__input {
    display: block;
    width: 100%;
    height: 2.25rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-family: var(--font-body);
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    color: hsl(var(--foreground));
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .field__input:focus {
        outline: none;
        border-color: hsl(var(--ring));
        box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
    }

.field__input--error {
    border-color: hsl(var(--destructive)) !important;
}

.field__error {
    font-size: 0.75rem;
    color: hsl(var(--destructive));
    margin-top: 0.25rem;
}

.field__input--readonly {
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    cursor: default;
}

.field__suffix {
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
}

.field__wrap {
    position: relative;
}

/* ----------------------------------------------------------
   4. SELECT (custom)
   ---------------------------------------------------------- */
.field__select {
    display: block;
    width: 100%;
    height: 2.25rem;
    padding: 0 2rem 0 0.75rem;
    font-size: 0.875rem;
    font-family: var(--font-body);
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    color: hsl(var(--foreground));
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .field__select:focus {
        outline: none;
        border-color: hsl(var(--ring));
        box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
    }

/* ----------------------------------------------------------
   5. STEP WIZARD
   ---------------------------------------------------------- */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 28rem;
    margin: 0 auto 2rem;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font-body);
    padding: 0;
}

.wizard-step__circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}

.wizard-step__circle--active {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.wizard-step__circle--done {
    background: hsl(var(--accent) / 0.2);
    color: hsl(var(--accent));
}

.wizard-step__circle--pending {
    background: hsl(var(--secondary));
    color: hsl(var(--muted-foreground));
}

.wizard-step__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
}

.wizard-line {
    flex: 1;
    height: 2px;
    margin-top: -1.25rem;
    transition: background 0.2s;
}

.wizard-line--done {
    background: hsl(var(--accent) / 0.4);
}

.wizard-line--pending {
    background: hsl(var(--secondary));
}

/* ----------------------------------------------------------
   6. LINE ITEMS
   ---------------------------------------------------------- */
.line-item {
    border-radius: 0.5rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--secondary));
    padding: 1rem;
}

.line-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.line-item__number {
    font-size: 0.75rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
}

/* ----------------------------------------------------------
   7. TAX BREAKDOWN ROW
   ---------------------------------------------------------- */
.tax-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--muted) / 0.4);
    padding: 0.75rem;
    font-size: 0.875rem;
}

.tax-row__label {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    display: block;
}

.tax-row__value {
    font-weight: 500;
}

/* ----------------------------------------------------------
   8. SUMMARY
   ---------------------------------------------------------- */
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.875rem;
}

.summary-row__label {
    color: hsl(var(--muted-foreground));
}

.summary-row__value {
    font-weight: 500;
}

.summary-row--grand .summary-row__value {
    font-size: 1rem;
    font-weight: 700;
    color: hsl(var(--accent));
}

.summary-separator {
    border: none;
    border-top: 1px solid hsl(var(--border));
    margin: 0.5rem 0;
}

/* ----------------------------------------------------------
   9. TOTALS BAR
   ---------------------------------------------------------- */
.totals-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
    padding: 1.5rem;
}

.totals-bar__label {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    display: block;
    margin-bottom: 0.25rem;
}

.totals-bar__value {
    font-size: 1.125rem;
    font-weight: 700;
}

.totals-bar__value--grand {
    font-size: 1.25rem;
    color: hsl(var(--accent));
}

/* ----------------------------------------------------------
   10. TOAST NOTIFICATION (moved to style.css)
   ---------------------------------------------------------- */
/* (All toast styles moved to style.css for global reuse) */

/* ----------------------------------------------------------
   11. GRID HELPERS
   ---------------------------------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

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

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

.grid-6 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

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

/* ----------------------------------------------------------
   12. CONTENT SECTION (below form)
   ---------------------------------------------------------- */
.content-section {
    border-top: 1px solid hsl(215 25% 16%);
    background: hsl(215 25% 14% / 0.3);
}

    .content-section .content-inner {
        max-width: 56rem;
        margin: 0 auto;
        padding: 5rem 1rem;
    }

.content-pillar {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.content-pillar__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    width: 2.25rem;
    border-radius: 0.5rem;
    background: hsl(160 84% 39% / 0.1);
    color: hsl(160 84% 39%);
}

.content-table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 0.5rem;
    border: 1px solid hsl(215 25% 16%);
}

    .content-table th {
        padding: 0.625rem 1rem;
        text-align: left;
        font-weight: 500;
        color: hsl(215 20% 55%);
        background: hsl(215 25% 14% / 0.6);
        border-bottom: 1px solid hsl(215 25% 16%);
    }

    .content-table td {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid hsl(215 25% 16%);
    }

    .content-table tr:last-child td {
        border-bottom: none;
    }

    .content-table td:first-child {
        font-weight: 500;
        color: hsl(210 40% 96%);
    }

    .content-table td:last-child {
        color: hsl(215 20% 55%);
    }

/* FAQ Accordion */
.faq-item {
    border-bottom: 1px solid hsl(215 25% 16%);
}

.faq-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 0;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    color: hsl(210 40% 96%);
    cursor: pointer;
    text-align: left;
}

    .faq-trigger:hover {
        color: hsl(160 84% 63%);
    }

    .faq-trigger svg {
        transition: transform 0.2s;
        flex-shrink: 0;
    }

.faq-item.is-open .faq-trigger svg {
    transform: rotate(180deg);
}

.faq-answer {
    display: none;
    padding-bottom: 1rem;
    font-size: 0.875rem;
    color: hsl(215 20% 55%);
    line-height: 1.6;
}

.faq-item.is-open .faq-answer {
    display: block;
}
