/*
=====================================================
CALCULATOR SHARED STYLES
=====================================================
Common styles shared across all calculator pages.
Loaded after styles.css. Uses variables from the
global design system defined in styles.css :root.
=====================================================
*/

/* ============================================
   BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--gray-900);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
main h1 {
    font-family: var(--font-family);
    font-weight: 700;
    color: var(--primary-blue-dark);
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

main h2 {
    font-family: var(--font-family);
    font-weight: 700;
    color: var(--primary-blue-dark);
    font-size: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-blue);
}

main h3 {
    font-family: var(--font-family);
    font-weight: 600;
    color: var(--primary-blue-dark);
    font-size: 1.4rem;
    margin: 1.5rem 0 0.75rem;
}

main p {
    margin-bottom: 1rem;
    color: var(--gray-600);
    line-height: 1.8;
}

main ul,
main ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

main li {
    margin-bottom: 0.5rem;
    color: var(--gray-600);
    line-height: 1.7;
}

main a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

main a:hover {
    color: var(--warning);
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--gray-500);
    font-weight: 400;
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(26, 77, 122, 0.05);
}

.content-section h2 {
    margin-top: 0;
}

.content-section ul,
.content-section ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

/* ============================================
   FAQ STYLES
   ============================================ */
.faq-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-question {
    font-weight: 600;
    color: var(--primary-blue-dark);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.faq-answer,
.faq-item p {
    color: var(--gray-600);
    line-height: 1.8;
}

/* ============================================
   HIGHLIGHT / TIP / WARNING BOXES
   ============================================ */
.highlight-box,
.tip-box {
    background: var(--primary-blue-light);
    border-left: 4px solid var(--primary-blue);
    padding: 1.25rem;
    margin: 1.25rem 0;
    border-radius: 4px;
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid var(--warning);
    padding: 1.25rem;
    margin: 1.25rem 0;
    border-radius: 4px;
}

.success-box {
    background: #d1fae5;
    border-left: 4px solid var(--success);
    padding: 1.25rem;
    margin: 1.25rem 0;
    border-radius: 4px;
}

/* ============================================
   RELATED CALCULATORS
   ============================================ */
.related-calculators {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 30px;
    margin-top: 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.related-calculators h2 {
    margin-bottom: 1.2rem;
    text-align: left;
    border-bottom: none;
    padding-bottom: 0;
}

.calculator-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.calc-link {
    display: block;
    padding: 15px 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary-blue-dark);
    font-weight: 600;
    border: 2px solid #bfdbfe;
    transition: all 0.3s;
}

.calc-link:hover {
    transform: translateX(5px);
    border-color: var(--primary-blue);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
    color: var(--primary-blue-dark);
}

.calc-link-desc {
    font-size: 0.9em;
    font-weight: 400;
    color: var(--gray-500);
    margin-top: 5px;
}

/* Also support the calculator-grid-links / calculator-link pattern (ROI) */
.calculator-grid-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* ============================================
   COMMON FORM ELEMENTS
   ============================================ */
label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
    font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: var(--font-family);
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--gray-900);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(26, 77, 122, 0.1);
}

input::placeholder {
    color: var(--gray-400);
}

/* ============================================
   COMMON BUTTON STYLES
   ============================================ */
.btn-calculate,
.calculate-btn {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-family);
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-calculate:hover,
.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(26, 77, 122, 0.3);
}

.btn-reset,
.reset-btn,
.reset-button {
    background: var(--gray-500);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease;
}

.btn-reset:hover,
.reset-btn:hover,
.reset-button:hover {
    background: var(--gray-600);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

button {
    font-family: var(--font-family);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

*:focus-visible {
    outline: 3px solid var(--warning);
    outline-offset: 2px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    main h1 {
        font-size: 2rem;
    }

    main h2 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .content-section {
        padding: 1.5rem;
    }

    .calculator-links,
    .calculator-grid-links {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .related-calculators,
    .back-link,
    .breadcrumb {
        display: none;
    }

    .content-section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--gray-200);
    }

    body {
        background: white;
    }
}
