/* ============================================================
   Tubefinder Impact Calculator — Stylesheet v1.1
   ============================================================ */

@font-face {
    font-family: 'TT Norms';
    src: url('../fonts/TTNorms-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'TT Norms';
    src: url('../fonts/TTNorms-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ── Custom properties ── */
.tfic-wrapper {
    --tfic-green:        #3dab80;
    --tfic-green-dark:   #2e8b66;
    --tfic-green-light:  #e6f5ee;
    --tfic-green-mid:    #c5e8d6;
    --tfic-blue:         #2b7db5;
    --tfic-blue-dark:    #005696;
    --tfic-blue-light:   #e3f0fa;
    --tfic-blue-mid:     #bcd8ef;
    --tfic-text:         #1a1a1a;
    --tfic-text-muted:   #555;
    --tfic-border:       #dde5ed;
    --tfic-bg:           #f4f6f8;
    --tfic-radius:       12px;
    --tfic-shadow:       0 4px 20px rgba(0,0,0,.08);

    font-family: 'TT Norms', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--tfic-text);
    line-height: 1.5;
    max-width: 860px;
    margin: 0 auto;
    box-sizing: border-box;
}

.tfic-wrapper *, .tfic-wrapper *::before, .tfic-wrapper *::after {
    box-sizing: inherit;
}

/* ── Intro / logo ── */
.tfic-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.tfic-logo {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    order: 2;
}

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

.tfic-intro-text {
    order: 1;
}

.tfic-intro-text h2 {
    font-family: 'TT Norms', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--tfic-blue-dark);
    margin: 0 0 4px;
}

.tfic-intro-text h3 {
    font-family: 'TT Norms', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--tfic-text);
    margin: 0 0 8px;
}

.tfic-intro-text p {
    font-size: .95rem;
    color: var(--tfic-text-muted);
    margin: 0;
    max-width: 600px;
}

/* ── Form section ── */
.tfic-form-section {
    background: #fff;
    border-radius: var(--tfic-radius);
    box-shadow: var(--tfic-shadow);
    padding: 32px;
    margin-bottom: 32px;
}

/* ── Input table ── */
.tfic-table-wrap {
    overflow-x: auto;
    margin-bottom: 20px;
}

.tfic-input-table {
    width: 100%;
    border-collapse: collapse;
}

.tfic-input-table thead th {
    text-align: left;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tfic-text-muted);
    padding: 0 8px 10px;
    border-bottom: 2px solid var(--tfic-border);
}

.tfic-input-table thead th:nth-child(2) { width: 160px; }
.tfic-input-table thead th:nth-child(3) { width: 48px; }

.tfic-row td {
    padding: 8px;
    vertical-align: middle;
    border-bottom: 1px solid var(--tfic-border);
}
.tfic-row:last-child td { border-bottom: none; }

/* ── Inputs ── */
.tfic-select,
.tfic-input {
    font-family: 'TT Norms', sans-serif;
    font-size: .95rem;
    color: var(--tfic-text);
    border: 1.5px solid var(--tfic-border);
    border-radius: 8px;
    padding: 10px 14px;
    width: 100%;
    background: #fff;
    transition: border-color .2s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.tfic-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.tfic-select:focus,
.tfic-input:focus { border-color: var(--tfic-blue-dark); }

.tfic-input[type="number"] {
    -moz-appearance: textfield;
    text-align: right;
}
.tfic-input[type="number"]::-webkit-inner-spin-button,
.tfic-input[type="number"]::-webkit-outer-spin-button { opacity: 1; }

/* ── Remove button ── */
.tfic-btn-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s, background .2s;
}
.tfic-btn-remove:hover { color: #e74c3c; background: #fef0ee; }

/* ── Form actions ── */
.tfic-form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.tfic-btn-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'TT Norms', sans-serif;
    font-size: .9rem;
    font-weight: 700;
    color: var(--tfic-blue-dark);
    background: none;
    border: 2px solid var(--tfic-blue-dark);
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.tfic-btn-add:hover { background: var(--tfic-blue-dark); color: #fff; }

.tfic-btn-calculate {
    font-family: 'TT Norms', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--tfic-blue-dark);
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    cursor: pointer;
    margin-left: auto;
    transition: background .2s, transform .1s;
}
.tfic-btn-calculate:hover { background: #004070; }
.tfic-btn-calculate:active { transform: scale(.98); }

/* ── Error ── */
.tfic-error {
    background: #fef3f2;
    border: 1.5px solid #fca99e;
    color: #c0392b;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: .9rem;
    margin-top: 12px;
    display: none;
}

/* ── Results ── */
.tfic-results {
    animation: tfic-fade-in .4s ease;
}
@keyframes tfic-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Print header (verborgen op scherm) */
.tfic-print-header { display: none; }

/* ── Project overzicht ── */
.tfic-project-overview {
    background: #fff;
    border-radius: var(--tfic-radius);
    box-shadow: var(--tfic-shadow);
    padding: 24px 28px;
    margin-bottom: 20px;
}

.tfic-overview-heading {
    font-family: 'TT Norms', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--tfic-blue-dark);
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.tfic-overview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}

.tfic-overview-table th {
    text-align: left;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--tfic-text-muted);
    padding: 6px 10px;
    border-bottom: 2px solid var(--tfic-border);
}

.tfic-overview-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--tfic-border);
    color: var(--tfic-text);
}

.tfic-overview-table th:not(:first-child),
.tfic-overview-table td:not(:first-child) {
    text-align: right;
}

.tfic-overview-table tbody tr:last-child td {
    border-bottom: none;
}

.tfic-overview-total td {
    padding-top: 12px;
    border-top: 2px solid var(--tfic-blue-dark) !important;
    border-bottom: none !important;
    color: var(--tfic-blue-dark);
}

/* ── Grote kaarten ── */
.tfic-cards-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.tfic-card {
    border-radius: var(--tfic-radius);
    padding: 28px 28px 32px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    min-height: 160px;
}

.tfic-card--co2   { background: var(--tfic-green); }
.tfic-card--water { background: var(--tfic-blue); }

.tfic-card-content { flex: 1; }

.tfic-card-label {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255,255,255,.9);
    line-height: 1.3;
    margin-bottom: 12px;
}

.tfic-card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    word-break: break-word;
}

/* Icon in grote kaart: wit, groot */
.tfic-card-icon {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    color: rgba(255,255,255,.85);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tfic-card-icon svg {
    width: 100%;
    height: 100%;
}

/* ── Kleine kaarten ── */
.tfic-cards-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.tfic-secondary-block {
    background: var(--tfic-bg);
    border-radius: var(--tfic-radius);
    padding: 24px;
}

.tfic-secondary-title {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 4px;
}
.tfic-secondary-block--co2   .tfic-secondary-title { color: var(--tfic-green-dark); }
.tfic-secondary-block--water .tfic-secondary-title { color: var(--tfic-blue-dark); }

.tfic-secondary-value {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 14px;
}
.tfic-secondary-block--co2   .tfic-secondary-value { color: var(--tfic-green-dark); }
.tfic-secondary-block--water .tfic-secondary-value { color: var(--tfic-blue-dark); }

/* Huishouden card */
.tfic-household-card {
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: 8px;
    padding: 12px 14px;
}
.tfic-household-card--co2   { background: var(--tfic-green-mid); }
.tfic-household-card--water { background: var(--tfic-blue-mid); }

/* Huishouden icon: gebruik SVG kleur via currentColor */
.tfic-household-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tfic-household-icon svg {
    width: 100%;
    height: 100%;
}
.tfic-household-card--co2   .tfic-household-icon { color: var(--tfic-green-dark); }
.tfic-household-card--water .tfic-household-icon { color: var(--tfic-blue-dark); }

.tfic-household-text { display: flex; flex-direction: column; }

.tfic-household-number {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}
.tfic-household-card--co2   .tfic-household-number { color: var(--tfic-green-dark); }
.tfic-household-card--water .tfic-household-number { color: var(--tfic-blue-dark); }

.tfic-household-label {
    font-size: .82rem;
    color: var(--tfic-text-muted);
    margin-top: 2px;
}

/* ── Results actions ── */
.tfic-results-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.tfic-btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'TT Norms', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    background: var(--tfic-blue-dark);
    border: none;
    border-radius: 8px;
    padding: 11px 22px;
    cursor: pointer;
    transition: background .2s;
}
.tfic-btn-pdf:hover { background: #004070; }

.tfic-btn-reset {
    font-family: 'TT Norms', sans-serif;
    font-size: .9rem;
    font-weight: 400;
    color: var(--tfic-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: color .2s, background .2s;
}
.tfic-btn-reset:hover { color: var(--tfic-blue-dark); background: var(--tfic-blue-light); }

/* ══════════════════════════════════════════
   PRINT — alleen actief in het popup-printvenster
   (de hoofdpagina print via een apart window.open)
   ══════════════════════════════════════════ */
@media print {
    .tfic-wrapper { max-width: 100%; }

    .tfic-card,
    .tfic-card--co2,
    .tfic-card--water,
    .tfic-secondary-block,
    .tfic-household-card {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .tfic-project-overview {
        box-shadow: none;
        border: 1px solid #dde5ed;
        page-break-inside: avoid;
    }

    .tfic-card        { page-break-inside: avoid; }
    .tfic-card-value  { font-size: 1.4rem; }
    .tfic-card-icon   { width: 56px; height: 56px; }

    .tfic-secondary-block { page-break-inside: avoid; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .tfic-form-section { padding: 20px 16px; }

    .tfic-cards-main,
    .tfic-cards-secondary { grid-template-columns: 1fr; }

    .tfic-card { min-height: auto; padding: 20px 18px 24px; }
    .tfic-card-icon { width: 60px; height: 60px; }
    .tfic-card-value { font-size: 1.4rem; }

    .tfic-btn-calculate { width: 100%; margin-left: 0; text-align: center; }

    .tfic-intro { flex-direction: column; text-align: center; }
    .tfic-form-actions { flex-direction: column; align-items: stretch; }
    .tfic-btn-add { justify-content: center; }

    .tfic-results-actions { flex-direction: column; align-items: stretch; }
    .tfic-btn-pdf { justify-content: center; }
}
