/* ============================================================
   Tubefinder Impact Calculator — Stylesheet v2.0
   ============================================================ */

@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 {
    --green:        #3dab80;
    --green-dark:   #2e8b66;
    --green-light:  #e6f5ee;
    --green-mid:    #c5e8d6;
    --blue:         #2b7db5;
    --blue-dark:    #005696;
    --blue-light:   #e3f0fa;
    --blue-mid:     #bcd8ef;
    --text:         #1a1a1a;
    --text-muted:   #666;
    --border:       #dde5ed;
    --bg:           #f4f6f8;
    --radius:       12px;
    --shadow:       0 2px 16px rgba(0,0,0,.07);

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

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

/* ── Header ── */
.tfic-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px 32px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.tfic-header-logo {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}
.tfic-header-logo img {
    width: 100%;
    height: 100%;
    display: block;
}

.tfic-header-text {
    border-left: 2px solid var(--border);
    padding-left: 24px;
}

.tfic-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--green-dark);
    margin: 0 0 4px;
}

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

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

.tfic-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--blue-dark);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 0 0 20px;
}

.tfic-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Contact grid ── */
.tfic-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tfic-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tfic-field label {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text-muted);
}

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

.tfic-input:focus,
.tfic-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(61,171,128,.12);
}

.tfic-input.tfic-invalid {
    border-color: #e74c3c;
}

.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='%23666' 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-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; }

/* ── Pipe tabel ── */
.tfic-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
}

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

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

.tfic-th-km { width: 150px; }

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

.tfic-btn-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s, background .15s;
}
.tfic-btn-remove:hover { color: #e74c3c; background: #fef0ee; }

/* ── Pipes footer ── */
.tfic-pipes-footer {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

/* ── Overview tabel ── */
.tfic-overview-wrap {
    overflow-x: auto;
    margin-bottom: 20px;
}

.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(--text-muted);
    padding: 7px 10px;
    border-bottom: 2px solid var(--border);
}
.tfic-overview-table th:not(:first-child) { text-align: right; }

.tfic-overview-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
}
.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(--blue-dark) !important;
    border-bottom: none !important;
    color: var(--blue-dark);
    font-weight: 700;
}

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

.tfic-card {
    border-radius: var(--radius);
    padding: 24px 24px 28px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-height: 140px;
}
.tfic-card--co2   { background: var(--green); }
.tfic-card--water { background: var(--blue); }

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

.tfic-card-label {
    font-size: .88rem;
    font-weight: 400;
    color: rgba(255,255,255,.85);
    margin-bottom: 8px;
}

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

.tfic-card-sub {
    font-size: .9rem;
    color: rgba(255,255,255,.75);
    margin-top: 4px;
}

.tfic-card-icon {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    color: rgba(255,255,255,.8);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tfic-card-icon svg { width: 100%; height: 100%; }

/* ── Huishoudens ── */
.tfic-cards-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 4px;
}

.tfic-secondary-block {
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.tfic-secondary-block--co2   { background: var(--green-light); }
.tfic-secondary-block--water { background: var(--blue-light); }

.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-secondary-block--co2   .tfic-household-icon { color: var(--green-dark); }
.tfic-secondary-block--water .tfic-household-icon { color: var(--blue-dark); }

.tfic-household-body { flex: 1; }

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

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

/* ── Download sectie ── */
.tfic-download-section { border-top: 3px solid var(--green); }

.tfic-download-intro {
    font-size: .93rem;
    color: var(--text-muted);
    margin: 0 0 20px;
}

.tfic-akkoord-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: .93rem;
    line-height: 1.5;
}

.tfic-akkoord-label input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--green);
}

.tfic-download-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.tfic-btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'TT Norms', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--green);
    border: none;
    border-radius: 8px;
    padding: 12px 26px;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}
.tfic-btn-download:hover:not(:disabled) { background: var(--green-dark); }
.tfic-btn-download:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ── Feedback ── */
.tfic-feedback {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: .92rem;
}
.tfic-feedback--success {
    background: var(--green-light);
    border: 1.5px solid var(--green);
    color: var(--green-dark);
}
.tfic-feedback--error {
    background: #fef3f2;
    border: 1.5px solid #fca99e;
    color: #c0392b;
}
.tfic-feedback--loading {
    background: var(--bg);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
}

/* ── Animatie ── */
.tfic-results-section,
.tfic-download-section {
    animation: tfic-in .3s ease;
}
@keyframes tfic-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .tfic-header { flex-direction: column; gap: 16px; padding: 20px; }
    .tfic-header-logo { width: 180px; }
    .tfic-header-text { border-left: none; padding-left: 0; border-top: 2px solid var(--border); padding-top: 16px; width: 100%; }

    .tfic-section { padding: 20px 16px; }

    .tfic-contact-grid { grid-template-columns: 1fr; }

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

    .tfic-card { min-height: auto; }
    .tfic-card-icon { width: 56px; height: 56px; }
    .tfic-card-value { font-size: 1.4rem; }

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