/**
 * Tools Page Styles
 * HB Power Tower - Kadence Child Theme
 */

/* ============================================================
   TOOLS PAGE - IMAGE INJECTION
   ============================================================ */

/* Hero section background with calculator/tech image */
section.relative.bg-\[\#0F172A\].text-white {
    position: relative;
}

section.relative.bg-\[\#0F172A\].text-white::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, oklch(0.20 0.03 250 / 0.93) 0%, oklch(0.15 0.02 250 / 0.88) 100%),
        url('/wp-content/uploads/tower-images/lattice-01.jpg') center/cover no-repeat;
    z-index: 0;
}

section.relative.bg-\[\#0F172A\].text-white > * {
    position: relative;
    z-index: 1;
}

/* ============================================================
   CONTAINER FIXES
   ============================================================ */
section.bg-slate-50,
section.bg-slate-900,
section.bg-\[\#0F172A\],
section.bg-\[\#F5F7FA\],
section.bg-white {
    width: 100%;
}

section .max-w-6xl,
section .max-w-5xl,
section .max-w-4xl,
section .max-w-3xl,
section .max-w-2xl {
    margin-left: auto !important;
    margin-right: auto !important;
}

.hw-tools-hero {
    background: var(--hw-navy);
    padding: var(--space-16) 0 var(--space-12);
    text-align: center;
}

.hw-tools-hero h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2rem, 4vw, var(--text-5xl));
    color: var(--hw-white);
    margin-bottom: var(--space-3);
}

.hw-tools-hero p {
    font-size: var(--text-lg);
    color: var(--hw-gray-300);
    max-width: 700px;
    margin: 0 auto;
}

.hw-calculator {
    padding: var(--space-16) 0;
    background: var(--hw-gray-50);
}

.hw-calculator .kt-row-column-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.hw-calculator-card {
    background: var(--hw-white);
    border-radius: var(--radius-xl);
    padding: var(--space-10);
    box-shadow: var(--shadow-lg);
}

/* Calculator steps */
.hw-calc-steps {
    display: flex;
    justify-content: center;
    gap: var(--space-8);
    margin-bottom: var(--space-10);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--hw-gray-200);
}

.hw-calc-step {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--hw-gray-400);
    letter-spacing: var(--tracking-wide);
}

.hw-calc-step.active {
    color: var(--hw-orange);
}

.hw-calc-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hw-gray-100);
    font-weight: 700;
    font-size: var(--text-sm);
}

.hw-calc-step.active .hw-calc-step-number {
    background: var(--hw-orange);
    color: var(--hw-white);
}

/* Calculator form */
.hw-calc-form-group {
    margin-bottom: var(--space-6);
}

.hw-calc-label {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--hw-gray-700);
    margin-bottom: var(--space-2);
    letter-spacing: var(--tracking-wide);
}

.hw-calc-select,
.hw-calc-input {
    width: 100%;
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--hw-gray-800);
    background: var(--hw-gray-50);
    border: 2px solid var(--hw-gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    transition: all var(--duration-fast) var(--ease-out-quart);
}

.hw-calc-select:focus,
.hw-calc-input:focus {
    border-color: var(--hw-orange);
    background: var(--hw-white);
    box-shadow: 0 0 0 3px oklch(0.65 0.15 50 / 0.15);
    outline: none;
}

.hw-calc-select {
    appearance: none;
    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='%234A5568' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-4) center;
    padding-right: var(--space-10);
}

/* Tower type selector */
.hw-tower-types {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.hw-tower-type {
    padding: var(--space-4);
    background: var(--hw-gray-50);
    border: 2px solid var(--hw-gray-200);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out-quart);
}

.hw-tower-type:hover {
    border-color: var(--hw-gray-300);
    background: var(--hw-white);
}

.hw-tower-type.selected {
    border-color: var(--hw-orange);
    background: oklch(0.65 0.15 50 / 0.05);
}

.hw-tower-type-icon {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-2);
}

.hw-tower-type-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-xs);
    color: var(--hw-gray-700);
}

/* Slider */
.hw-calc-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--hw-gray-200);
    appearance: none;
    outline: none;
    margin-top: var(--space-2);
}

.hw-calc-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--hw-orange);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform var(--duration-fast) var(--ease-out-quart);
}

.hw-calc-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.hw-calc-slider-value {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--hw-navy);
    text-align: center;
    margin-top: var(--space-2);
}

/* Calculator buttons */
.hw-calc-buttons {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-8);
}

.hw-calc-btn-primary {
    flex: 1;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    background: var(--hw-orange);
    color: var(--hw-white);
    border: none;
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out-quart);
}

.hw-calc-btn-primary:hover {
    background: var(--hw-orange-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.hw-calc-btn-secondary {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    background: transparent;
    color: var(--hw-gray-600);
    border: 2px solid var(--hw-gray-200);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out-quart);
}

.hw-calc-btn-secondary:hover {
    border-color: var(--hw-gray-300);
    color: var(--hw-navy);
}

/* Results */
.hw-calc-results {
    margin-top: var(--space-8);
    padding-top: var(--space-8);
    border-top: 1px solid var(--hw-gray-200);
}

.hw-calc-results-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-xl);
    color: var(--hw-navy);
    margin-bottom: var(--space-6);
}

.hw-calc-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.hw-calc-result {
    padding: var(--space-5);
    background: var(--hw-gray-50);
    border-radius: var(--radius-md);
    text-align: center;
}

.hw-calc-result-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-xs);
    color: var(--hw-gray-500);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    margin-bottom: var(--space-2);
}

.hw-calc-result-value {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: var(--text-2xl);
    color: var(--hw-navy);
}

.hw-calc-result-unit {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--hw-gray-500);
}

@media (max-width: 768px) {
    .hw-tower-types {
        grid-template-columns: repeat(2, 1fr);
    }

    .hw-calc-steps {
        flex-direction: column;
        align-items: center;
        gap: var(--space-4);
    }

    .hw-calc-buttons {
        flex-direction: column;
    }

    .hw-calc-results-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   TOOLS PAGE REFRESH - Engineering calculator
   ============================================================ */

body.page-id-41 .entry-hero {
    display: none;
}

body.page-id-41 .entry-content-wrap,
body.page-id-41 .single-content {
    padding: 0 !important;
}

.hw-tools-page {
    --tools-navy: #0f172a;
    --tools-blue: #17324d;
    --tools-ink: #102a43;
    --tools-muted: #526173;
    --tools-orange: #f47920;
    --tools-line: rgba(26, 58, 92, 0.12);
    background: #f6f8fb;
    color: var(--tools-ink);
}

.hw-tools-container {
    width: min(100% - 32px, 1180px);
    margin-inline: auto;
}

.hw-tools-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(76px, 9vw, 124px) 0 clamp(52px, 7vw, 86px);
    background:
        linear-gradient(120deg, rgba(15, 23, 42, 0.95), rgba(26, 58, 92, 0.88)),
        url("/wp-content/uploads/tower-images/lattice-02.jpg") center / cover no-repeat;
    color: #ffffff;
}

.hw-tools-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.25;
}

.hw-tools-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.7fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: center;
}

.hw-tools-eyebrow,
.hw-tools-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hw-tools-eyebrow {
    margin-bottom: 18px;
    padding: 8px 13px;
    background: rgba(244, 121, 32, 0.16);
    color: #fed7aa;
    border: 1px solid rgba(244, 121, 32, 0.24);
}

.hw-tools-hero h1 {
    max-width: 820px;
    margin: 0 0 20px;
    color: #ffffff;
    font-family: var(--font-display, inherit);
    font-size: clamp(38px, 6vw, 72px);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.hw-tools-hero p {
    max-width: 680px;
    margin: 0;
    color: #cbd5e1;
    font-size: clamp(16px, 2vw, 19px);
    line-height: 1.75;
}

.hw-tools-hero-panel {
    border-radius: 28px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 24px 70px rgba(0, 0, 0, 0.24);
}

.hw-tools-hero-panel strong {
    display: block;
    color: #ffffff;
    font-family: var(--font-display, inherit);
    font-size: 38px;
    line-height: 1;
}

.hw-tools-hero-panel span {
    display: block;
    margin-top: 8px;
    color: #cbd5e1;
    font-size: 14px;
}

.hw-tools-hero-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.hw-tools-hero-metric {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
}

.hw-tools-main {
    padding: clamp(58px, 8vw, 96px) 0;
}

.hw-tools-intro {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    gap: 32px;
    align-items: start;
    margin-bottom: 34px;
}

.hw-tools-intro h2,
.hw-tools-section-title {
    margin: 0 0 14px;
    color: var(--tools-ink);
    font-family: var(--font-display, inherit);
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.hw-tools-intro p,
.hw-tools-section-copy {
    color: var(--tools-muted);
    line-height: 1.72;
}

.hw-tools-chip {
    margin-bottom: 14px;
    padding: 8px 12px;
    background: #eaf1f8;
    color: var(--tools-blue);
}

.hw-tools-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.hw-tools-benefit {
    padding: 20px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--tools-line);
    box-shadow: 0 14px 34px rgba(13, 27, 42, 0.06);
}

.hw-tools-benefit b {
    display: block;
    margin-bottom: 8px;
    color: var(--tools-blue);
}

.hw-tools-benefit p {
    margin: 0;
    color: var(--tools-muted);
    font-size: 14px;
    line-height: 1.62;
}

.hw-calculator-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

.hw-calculator-card,
.hw-tools-side-card,
.hw-tools-deliverables,
.hw-tools-note-card {
    border-radius: 28px;
    background: #ffffff;
    border: 1px solid var(--tools-line);
    box-shadow: 0 22px 60px rgba(13, 27, 42, 0.08);
}

.hw-calculator-card {
    padding: clamp(24px, 4vw, 38px);
}

.hw-calculator-progress {
    margin-bottom: 30px;
}

.hw-calculator-labels {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hw-calculator-labels [aria-current="step"] {
    color: var(--tools-orange);
}

.hw-calculator-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #eaf1f8;
}

.hw-calculator-bar {
    width: 33.33%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f47920, #f59e0b);
    transition: width 260ms ease;
}

.hw-tool-step.hidden,
.hw-tools-hidden {
    display: none !important;
}

.hw-tool-step h3 {
    margin: 0 0 18px;
    color: var(--tools-ink);
    font-size: 23px;
    font-weight: 900;
}

.hw-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.hw-field {
    display: grid;
    gap: 9px;
}

.hw-field label,
.hw-field legend {
    color: var(--tools-blue);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hw-field select,
.hw-field input[type="number"],
.hw-field input[type="range"] {
    width: 100%;
}

.hw-field select,
.hw-field input[type="number"] {
    min-height: 52px;
    border-radius: 14px;
    border: 1px solid rgba(26, 58, 92, 0.14);
    background: #ffffff;
    color: var(--tools-ink);
    padding: 0 14px;
    font-weight: 700;
}

.hw-field input[type="range"] {
    accent-color: var(--tools-orange);
}

.hw-choice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.hw-choice {
    position: relative;
    display: grid;
    gap: 7px;
    min-height: 94px;
    cursor: pointer;
    border-radius: 18px;
    border: 1px solid rgba(26, 58, 92, 0.13);
    background: #f8fafc;
    padding: 15px;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.hw-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.hw-choice strong {
    color: var(--tools-blue);
    font-size: 15px;
}

.hw-choice span {
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

.hw-choice:has(input:checked) {
    border-color: rgba(244, 121, 32, 0.72);
    background: #fff7ed;
    box-shadow: inset 0 0 0 1px rgba(244, 121, 32, 0.3);
}

.hw-calculator-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 26px;
}

.hw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid transparent;
    padding: 0 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.hw-btn:active {
    transform: translateY(1px);
}

.hw-btn-primary {
    background: var(--tools-orange);
    color: #ffffff !important;
    box-shadow: 0 12px 24px rgba(244, 121, 32, 0.22);
}

.hw-btn-dark {
    background: var(--tools-navy);
    color: #ffffff !important;
}

.hw-btn-ghost {
    background: #ffffff;
    color: var(--tools-blue) !important;
    border-color: rgba(26, 58, 92, 0.15);
}

.hw-calc-loader {
    padding: 38px 0;
    text-align: center;
}

.hw-loader-ring {
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border-radius: 50%;
    border: 5px solid #eaf1f8;
    border-top-color: var(--tools-orange);
    animation: hwToolsSpin 900ms linear infinite;
}

@keyframes hwToolsSpin {
    to {
        transform: rotate(360deg);
    }
}

.hw-result-panel {
    display: grid;
    gap: 18px;
}

.hw-result-summary {
    border-radius: 22px;
    background: var(--tools-navy);
    color: #cbd5e1;
    padding: 24px;
}

.hw-result-summary h4 {
    margin: 0 0 12px;
    color: #fed7aa;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hw-result-summary strong {
    color: #ffffff;
}

.hw-result-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.hw-result-metric {
    padding: 18px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid var(--tools-line);
}

.hw-result-metric b {
    display: block;
    color: var(--tools-blue);
    font-size: 24px;
}

.hw-result-metric span {
    color: var(--tools-muted);
    font-size: 12px;
    font-weight: 800;
}

.hw-form-embed {
    border-radius: 22px;
    background: #f8fafc;
    border: 1px solid var(--tools-line);
    padding: 18px;
}

.hw-form-embed .fluentform_wrapper label,
.hw-form-embed .fluentform_wrapper .ff-el-input--label {
    color: var(--tools-blue) !important;
    opacity: 1 !important;
}

.hw-tools-side-card {
    padding: 26px;
    position: sticky;
    top: 96px;
}

.hw-tools-side-card h3,
.hw-tools-deliverables h2,
.hw-tools-note-card h3 {
    margin: 0 0 14px;
    color: var(--tools-ink);
    font-weight: 900;
}

.hw-tools-side-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hw-tools-side-list li {
    padding: 14px 0;
    border-top: 1px solid var(--tools-line);
    color: var(--tools-muted);
    font-size: 14px;
    line-height: 1.55;
}

.hw-tools-side-list strong {
    display: block;
    margin-bottom: 4px;
    color: var(--tools-blue);
}

.hw-tools-deliverables {
    margin-top: 30px;
    padding: clamp(24px, 4vw, 36px);
}

.hw-deliverable-grid,
.hw-tools-notes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.hw-deliverable,
.hw-tools-note-card {
    padding: 22px;
    border-radius: 20px;
    border: 1px solid var(--tools-line);
    background: #ffffff;
}

.hw-deliverable strong {
    display: block;
    margin-bottom: 8px;
    color: var(--tools-blue);
}

.hw-deliverable p,
.hw-tools-note-card p {
    margin: 0;
    color: var(--tools-muted);
    font-size: 14px;
    line-height: 1.65;
}

.hw-tools-notes {
    margin-top: 22px;
}

@media (max-width: 980px) {
    .hw-tools-hero-grid,
    .hw-tools-intro,
    .hw-calculator-shell,
    .hw-tools-benefits,
    .hw-deliverable-grid,
    .hw-tools-notes {
        grid-template-columns: 1fr;
    }

    .hw-tools-side-card {
        position: static;
    }
}

@media (max-width: 720px) {
    .hw-tools-container {
        width: min(100% - 24px, 1180px);
    }

    .hw-tools-hero-metrics,
    .hw-field-grid,
    .hw-choice-grid,
    .hw-result-metrics {
        grid-template-columns: 1fr;
    }

    .hw-calculator-labels {
        display: grid;
    }

    .hw-calculator-actions {
        flex-direction: column;
    }

    .hw-btn {
        width: 100%;
    }
}
