/* HPC Cost Calculator — page styling.
 *
 * Inherits the site palette from landing.css (--caltech-orange, etc).
 * Mirrors the layout idiom of job-generator.css so the two tools pages
 * feel like siblings.
 */

.calc-main {
    max-width: 1100px;
    margin: 0 auto;
    /* Top padding clears the fixed navbar — matches .generator-main. */
    padding: 6rem 2rem 4rem;
}

.calc-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.calc-header h1 {
    color: var(--text-primary);
    font-size: 2.25rem;
    margin: 0 0 .5rem;
}

.calc-header .hero-description {
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.55;
}

.calc-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 880px) {
    .calc-grid { grid-template-columns: 1fr; }
}

/* ---- Form (left side) ---- */
.calc-form fieldset {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem 1.25rem;
    background: var(--bg-primary);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.calc-form legend {
    font-weight: 600;
    color: var(--caltech-orange);
    padding: 0 .5rem;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.calc-form fieldset > p.hint:first-of-type {
    margin: 0 0 .65rem;
    color: var(--text-muted);
    font-size: .85rem;
}

.calc-form label {
    display: block;
    margin: .55rem 0;
    color: var(--text-secondary);
    font-size: .9rem;
    font-weight: 500;
}

.calc-form label .hint {
    color: var(--text-muted);
    font-weight: 400;
    font-size: .8rem;
    margin-left: .35rem;
}

.calc-form input[type="number"],
.calc-form input[type="text"] {
    width: 100%;
    padding: .5rem .65rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin-top: .25rem;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
}

.calc-form input:focus {
    outline: none;
    border-color: var(--caltech-orange);
    box-shadow: 0 0 0 3px rgba(255, 108, 12, 0.15);
}

.calc-form .row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75rem;
}

/* ---- Pricing settings (collapsible) ---- */
.pricing-settings {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.pricing-settings summary {
    list-style: none;
    cursor: pointer;
    padding: .9rem 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    user-select: none;
}
.pricing-settings summary::-webkit-details-marker { display: none; }
.pricing-settings summary::after {
    content: "▾";
    float: right;
    color: var(--caltech-orange);
    transition: transform 0.2s;
}
.pricing-settings[open] summary::after { transform: rotate(180deg); }
.pricing-settings summary:hover { background: var(--bg-primary); }

.pricing-config { padding: 0 1.25rem 1.25rem; }

.pricing-config h3 {
    color: var(--text-secondary);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 1.1rem 0 .4rem;
    font-weight: 600;
}

.pricing-config .hint {
    color: var(--text-muted);
    font-size: .8rem;
    margin: 0 0 .65rem;
}

.tier-row {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    padding: .65rem .75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: .5rem;
}

.tier-row .tier-fields {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: .5rem;
}

.tier-row label {
    margin: 0;
    font-size: .82rem;
    color: var(--text-secondary);
}

.tier-remove {
    background: #fdecec;
    color: #b00020;
    border: 1px solid #f5b5b5;
    border-radius: var(--radius-sm);
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    margin-bottom: .12rem;
    transition: background .15s, border-color .15s;
}
.tier-remove:hover { background: #f5b5b5; border-color: #e88; }

.btn-secondary, .btn-ghost {
    border: none;
    border-radius: var(--radius-sm);
    padding: .55rem 1rem;
    font-size: .9rem;
    cursor: pointer;
    font-family: inherit;
    margin-top: .25rem;
    font-weight: 500;
}
.btn-secondary {
    background: var(--caltech-orange);
    color: white;
}
.btn-secondary:hover { background: var(--caltech-orange-dark); }
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    margin-top: 1.25rem;
}
.btn-ghost:hover { background: var(--bg-secondary); color: var(--text-primary); }

/* ---- Output (right side) ---- */
.calc-output {
    position: sticky;
    top: 80px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 1.25rem;
}

@media (max-width: 880px) {
    .calc-output { position: static; }
}

.total-display {
    background: var(--caltech-orange);
    color: white;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 1.25rem;
}

.total-label {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .9;
}

.total-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin: .25rem 0;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.total-period {
    font-size: .85rem;
    opacity: .9;
}

.breakdown h3 {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin: 0 0 .5rem;
    font-weight: 600;
}

.kv {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .42rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: .9rem;
}
.kv:last-child { border-bottom: none; }
.kv.emphasis {
    font-weight: 600;
    color: var(--text-primary);
}
.kv.subtle {
    color: var(--text-muted);
    font-size: .82rem;
    border-bottom: 1px dashed var(--border-color);
}
.kv > span:last-child {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tier-breakdown { margin: .15rem 0 .25rem; }

.caveat {
    margin-top: 1rem;
    padding: .75rem .9rem;
    background: var(--bg-secondary);
    border-left: 3px solid var(--caltech-orange);
    border-radius: var(--radius-sm);
    font-size: .85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.caveat p { margin: 0; }
.caveat a { color: var(--caltech-orange); }

.calc-footer {
    margin-top: 2.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem;
}
.calc-footer a { color: var(--caltech-orange); }
