/*
 * tool-forms.css
 * The calculators (Duty, Income Tax, VAT Assistant) in the Add Product / Service popup's design:
 * floating labels, bordered fields, tab containers and the pricing-table look. A copy of add_product.html's
 * #post-form styles, scoped to .tool-form.
 */

/* === Page card (as the summary pages) === */
.tool-page .card-header .card-subtitle { color: var(--text-gray); font-size: 0.8rem; }
.tool-page .card-body { padding: 1.25rem; }

/* === Floating label === */
.tool-form .form-outline {
    position: relative;
    margin-bottom: 1.5rem;
}
.tool-form .form-label {
    position: absolute;
    top: -0.6rem;
    left: 0.9rem;
    padding: 0 0.4rem;
    background: var(--background-white);
    color: var(--text-dark-medium, var(--text-dark));
    font-weight: 600;
    font-size: 0.75rem;
    pointer-events: none;
    z-index: 1;
}

/* === Form controls === */
.tool-form .form-control,
.tool-form .form-select {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    background-color: var(--background-white);
    color: var(--text-dark);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.tool-form .form-control:focus,
.tool-form .form-select:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px var(--primary-green-light);
    outline: none;
}
.tool-form .form-control[readonly] { background-color: var(--background-light); }
.tool-form .form-hint { display: block; margin-top: 4px; font-size: 0.7rem; color: var(--text-gray); }

/* Select2 inside a tool form: the same border as the fields */
.tool-form .select2-container--default .select2-selection--single,
.tool-form .select2-container--default .select2-selection--multiple {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    min-height: 38px;
    background-color: var(--background-white);
}

/* === Tab container (as Add Product) === */
.tool-form .tab-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    margin-bottom: 1rem;
}
.tool-form .custom-tabs {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 0 0.5rem;
    gap: 0;
    flex-wrap: wrap;
}
.tool-form .custom-tabs .nav-link {
    border: none;
    border-radius: 0;
    color: var(--text-gray);
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: -1px;
    background-color: transparent;
    position: relative;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.tool-form .custom-tabs .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--primary-green);
    border-radius: 2px 2px 0 0;
    transition: width 0.25s ease;
}
.tool-form .custom-tabs .nav-link:hover,
.tool-form .custom-tabs .nav-link.active { color: var(--primary-green); background-color: transparent; }
.tool-form .custom-tabs .nav-link:hover::after,
.tool-form .custom-tabs .nav-link.active::after { width: 60%; }
.tool-form .custom-tab-content {
    background-color: var(--background-white);
    padding: 1rem;
}
.tool-form .custom-tab-content .tab-pane > .form-outline:last-child,
.tool-form .custom-tab-content .tab-pane > .row:last-child > [class*="col"] > .form-outline { margin-bottom: 0; }

/* === Result / data tables (as the Add Product pricing table) === */
.tool-form .tool-table { overflow-x: auto; margin-bottom: 1rem; }
.tool-form .tool-table .table { margin-bottom: 0; }
.tool-form .tool-table .table thead th,
.tool-form .table-header th {
    background-color: var(--background-white);
    color: var(--text-dark);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}
.tool-form .tool-table .table > :not(caption) > * > * {
    background-color: var(--background-white);
    color: var(--text-dark);
    border-color: var(--border-color);
    vertical-align: middle;
}
.tool-form .tool-table .total-row td { font-weight: 700; color: var(--primary-green); }
.tool-form .tool-table .text-right { text-align: right; }
.tool-form .tool-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dark);
    margin: 0.5rem 0 0.5rem;
}

/* === Actions (as the popup's buttons) === */
.tool-form .tool-actions { display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }

/* === Messages === */
.tool-form .tool-error { color: #dc3545; font-size: 0.8rem; margin: -0.75rem 0 1rem; }
.tool-form .tool-loading { color: var(--text-gray); font-size: 0.8rem; margin: -0.75rem 0 1rem; }

/* === Pages that keep their original markup (Income Tax, VAT Assistant): .form-group fields as floating labels === */
.tool-form .form-group {
    position: relative;
    margin-bottom: 1.5rem;
}
.tool-form .form-group > label:not(.form-check-label) {
    position: absolute;
    top: -0.6rem;
    left: 0.9rem;
    padding: 0 0.4rem;
    background: var(--background-white);
    color: var(--text-dark-medium, var(--text-dark));
    font-weight: 600;
    font-size: 0.75rem;
    pointer-events: none;
    z-index: 2;
    max-width: calc(100% - 1.8rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tool-form .form-check-label { font-size: 0.85rem; }

/* every table on a tool page in the pricing-table look */
.tool-form .table thead th {
    background-color: var(--background-white);
    color: var(--text-dark);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}
.tool-form .table > :not(caption) > * > * {
    background-color: var(--background-white);
    color: var(--text-dark);
    border-color: var(--border-color);
    vertical-align: middle;
}
.tool-form .table .bold-row td,
.tool-form .table tr.bold-row td { font-weight: 700; }
.tool-form h4,
.tool-form h2 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin: 1rem 0 0.5rem; }
.tool-form .seo-content { font-size: 0.85rem; color: var(--text-dark); }
.tool-form .seo-content h2 { font-size: 0.9rem; }
