/**
 * Mecc Alte Tools - Shared Component Styles
 * Common UI components used across all tools.
 * Requires: shared.css (must be loaded first for CSS variables).
 */

/* ==============================================
   LAYOUT
   ============================================== */

.container {
    max-width: 100%;
}

/* ==============================================
   SHARED HEADER  (rb-header)
   Used by: PMG, Alternator Sizing Tool, Ratings Book
   ============================================== */

.rb-header {
    height: 85px;
    background: linear-gradient(90deg, #002f5c 0%, #004a90 100%);
    color: #fff;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 3px solid #0097a7;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: hidden;
}

.rb-header::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    background: #ff6d42;
    clip-path: polygon(100% 0, 0 0, 100% 100%);
    pointer-events: none;
    z-index: 0;
}

.rb-header-logo {
    position: relative;
    z-index: 1;
}

.rb-header-logo img {
    height: 34px;
    width: auto;
}

.rb-header-title {
    flex: 1;
    position: relative;
    z-index: 1;
}

.rb-header-title h1 {
    font-size: 1.35em;
    font-weight: 700;
    margin: 0;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.rb-header-title p {
    font-size: 0.82em;
    opacity: 0.75;
    margin: 2px 0 0;
    color: #fff;
}

.rb-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.btn-home:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}

.header {
    background: linear-gradient(90deg, var(--color-primary-dark) 50%, var(--color-primary-medium) 100%);
    color: var(--color-bg-white);
    padding: 34px 16px;
    text-align: center;
    border-bottom: 3px solid var(--color-accent-teal);
    position: relative;
    overflow: hidden;
}

/* Brand shape: isosceles right triangle — top-right corner */
.header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: var(--color-accent-orange);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
    pointer-events: none;
}

.header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    color: var(--color-bg-white);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.header p {
    opacity: 0.9;
    font-size: 1.05em;
    color: var(--color-bg-white);
}

.content {
    padding: 15px 15px;
    background: var(--color-bg-light);
}

/* Brand heading treatments inside content */
.content h2 {
    font-family: 'Klavika', 'Arial', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary-dark);
    padding-bottom: 10px;
    border-bottom: 2.5px solid var(--color-accent-teal);
    margin-bottom: 20px;
}

.content h3 {
    font-family: 'Klavika', 'Arial', sans-serif;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.logo-container {
    text-align: center;
    padding: 20px;
}

.logo-container img {
    width: 100%;
    max-width: 500px;
    height: auto;
}

/* ==============================================
   MODE SELECTOR
   ============================================== */

.mode-selector {
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px;
}

.mode-card {
    padding: 16px;
    border: 2px solid var(--color-neutral-gray);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
    background-color: rgba(240, 244, 248, 0.5);
    min-width: 200px;
}

.mode-card.active {
    border-color: var(--color-primary-dark);
    background-color: rgba(0, 73, 144, 0.08);
}

.mode-card:hover {
    border-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.mode-card h3 {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: var(--color-primary-dark);
}

.mode-card p {
    font-size: 0.9em;
    color: var(--color-medium-text);
    line-height: 1.4;
}

/* ==============================================
   FORMS
   ============================================== */

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-medium-text);
    font-family: 'Klavika', 'Arial', sans-serif;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

input, select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--color-neutral-gray);
    border-radius: var(--border-radius-sm);
    font-size: 1.04em;
    font-family: 'Panton', 'Arial', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--color-bg-white);
}

input::placeholder, textarea::placeholder {
    font-family: 'Panton', 'Arial', sans-serif;
    color: var(--color-neutral-gray);
    opacity: 0.8;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--color-primary-dark);
    box-shadow: 0 0 0 3px rgba(0, 73, 144, 0.08);
}

textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--color-neutral-gray);
    border-radius: var(--border-radius-sm);
    font-size: 1em;
    font-family: 'Panton', 'Arial', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--color-bg-white);
    resize: vertical;
    min-height: 100px;
}

textarea:focus {
    outline: none;
    border-color: var(--color-primary-dark);
    box-shadow: 0 0 0 3px rgba(0, 73, 144, 0.08);
}

/* ==============================================
   BUTTONS
   ============================================== */

.btn {
    background: linear-gradient(120deg, var(--color-primary-medium) 60%, var(--color-primary-dark) 100%);
    color: var(--color-bg-white);
    border: none;
    padding: 14px 0;
    font-size: 1.05em;
    font-weight: 600;
    font-family: 'Klavika', 'Arial', sans-serif;
    letter-spacing: 0.04em;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    margin-top: 18px;
    box-shadow: var(--shadow-md);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(120deg, var(--color-teal-dark) 70%, var(--color-primary-medium) 100%);
}

.btn-secondary {
    background: linear-gradient(90deg, var(--color-accent-teal) 80%, var(--color-teal-dark) 100%);
    color: var(--color-bg-white);
}

.btn-primary,
.btn-secondary-alt {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1em;
    font-weight: 600;
    font-family: 'Klavika', 'Arial', sans-serif;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent-teal) 0%, var(--color-teal-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(53, 196, 181, 0.4);
}

/* ==============================================
   BACK BUTTON
   ============================================== */

.btn-back {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: linear-gradient(120deg, var(--color-primary-medium) 60%, var(--color-primary-dark) 100%);
    color: var(--color-bg-white);
    border: none;
    padding: 16px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1em;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(26, 39, 50, 0.3);
    z-index: 1000;
    transition: all 0.3s;
    width: auto;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-back::before {
    content: '\2190 ';
    font-weight: bold;
}

.btn-back:hover {
    background: linear-gradient(135deg, var(--color-accent-orange) 0%, var(--color-accent-yellow) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(26, 39, 50, 0.4);
    color: white;
}

/* ==============================================
   MODAL
   ============================================== */

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--color-bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary-medium) 100%);
    color: white;
    padding: 20px 30px;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--color-accent-teal);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4em;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    padding: 0 10px;
}

.modal-close:hover {
    color: var(--color-accent-teal);
    transform: scale(1.2);
}

.modal-body {
    padding: 30px;
    background: var(--color-bg-light);
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-primary-dark);
    font-weight: 600;
    font-size: 0.95em;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(137, 150, 160, 0.3);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    background: var(--color-bg-white);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* ==============================================
   FOOTER
   ============================================== */

footer {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary-medium) 100%);
    color: var(--color-bg-white);
    padding: 25px 20px;
    text-align: center;
    border-top: 3px solid var(--color-accent-teal);
}

footer .footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

footer .footer-copyright {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

footer .footer-copyright .logo-container {
    display: inline-flex;
    align-items: center;
    padding: 0;
}

footer .footer-copyright .logo-container img {
    height: 30px;
    width: auto;
}

footer .footer-title {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

footer .footer-info {
    font-size: 13px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

footer .footer-divider {
    opacity: 0.5;
}

footer .footer-disclaimer {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 10px;
}

footer a {
    color: var(--color-bg-white);
    text-decoration: underline;
}

/* ==============================================
   HELP BUTTON
   ============================================== */

.help-button {
    position: fixed;
    top: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--color-accent-teal), var(--color-teal-dark));
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.05em;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(53, 196, 181, 0.4);
    z-index: 1000;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-button:hover {
    background: linear-gradient(135deg, var(--color-accent-orange), var(--color-accent-yellow));
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 109, 66, 0.4);
}

.help-button::before {
    content: '?';
    font-size: 1.2em;
}

/* ==============================================
   UTILITY CLASSES
   ============================================== */

.hidden {
    display: none;
}

.block-container {
    transition: all 0.3s ease;
}

.block-container.hidden {
    display: none;
}

/* ==============================================
   TERMS PAGE
   ============================================== */

.terms-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.terms-header {
    text-align: center;
    margin-bottom: 40px;
}

.terms-header img {
    height: 60px;
    margin-bottom: 20px;
}

.terms-header h1 {
    color: var(--color-primary-dark);
    font-size: 2em;
    margin: 0;
}

.terms-header p {
    color: var(--color-medium-text);
    font-size: 1.1em;
    margin: 10px 0 0 0;
}

.terms-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    border: 2px solid #e0e7f0;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    max-height: 600px;
    overflow-y: auto;
}

.terms-section {
    margin-bottom: 25px;
}

.terms-section h2 {
    color: var(--color-primary-dark);
    font-size: 1.3em;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-accent-teal);
}

.terms-section h3 {
    color: var(--color-accent-teal);
    font-size: 1.05em;
    margin: 15px 0 8px 0;
}

.terms-section p {
    color: var(--color-medium-text);
    line-height: 1.6;
    margin: 8px 0;
    font-size: 0.95em;
}

.terms-section ul {
    color: var(--color-medium-text);
    line-height: 1.6;
    margin: 8px 0 8px 20px;
    font-size: 0.95em;
}

.terms-section li {
    margin: 6px 0;
}

.terms-section strong {
    color: var(--color-primary-dark);
    font-weight: 600;
}

.highlight-box {
    background: #fff3cd;
    border-left: 4px solid var(--color-accent-yellow);
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
}

.warning-box {
    background: #f8d7da;
    border-left: 4px solid #f5c6cb;
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
    color: #721c24;
}

.acceptance-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 2px solid var(--color-accent-teal);
    margin-bottom: 30px;
}

.acceptance-section h2 {
    color: var(--color-primary-dark);
    margin-top: 0;
}

.checkbox-group {
    margin: 20px 0;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    margin: 12px 0;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #e0e7f0;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 2px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-item label {
    cursor: pointer;
    flex: 1;
    color: var(--color-medium-text);
    line-height: 1.5;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-accept {
    flex: 1;
    padding: 14px 20px;
    background: var(--color-accent-teal);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-accept:hover:not(:disabled) {
    background: #2aaa9d;
    box-shadow: 0 4px 12px rgba(53, 196, 181, 0.3);
}

.btn-accept:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-decline {
    flex: 1;
    padding: 14px 20px;
    background: var(--color-accent-orange);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-decline:hover {
    background: #e55a2f;
    box-shadow: 0 4px 12px rgba(255, 109, 66, 0.3);
}

.version-info {
    text-align: center;
    color: var(--color-neutral-gray);
    font-size: 0.9em;
    margin-top: 30px;
}

/* Scrollbar styling for terms */
.terms-content::-webkit-scrollbar {
    width: 8px;
}

.terms-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.terms-content::-webkit-scrollbar-thumb {
    background: var(--color-accent-teal);
    border-radius: 10px;
}

.terms-content::-webkit-scrollbar-thumb:hover {
    background: #2aaa9d;
}

/* ==============================================
   RESPONSIVE - SHARED COMPONENTS
   ============================================== */

/* ── Tablet (≤ 1200px) ── */
@media (max-width: 1200px) {
    .header {
        padding: 24px 16px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .header::after {
        width: 80px;
        height: 80px;
    }

    .form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .btn-back,
    .help-button {
        padding: 12px 20px;
        font-size: 1em;
    }

    .modal-content {
        max-width: 90%;
    }
}

/* ── rb-hamburger defaults (hidden on desktop) ── */
.rb-hamburger       { display: none; }
.rb-mobile-dropdown { display: none; }

/* ── rb-header Mobile (≤ 1200px) ── */
@media (max-width: 1200px) {
    /* Single row: logo + title + hamburger — no column stacking */
    .rb-header {
        flex-direction: row;
        align-items: center;
        padding: 0 16px;
        gap: 10px;
    }

    .rb-header::after {
        width: 36px;
        height: 36px;
    }

    .rb-header-logo img {
        height: 24px;
    }

    .rb-header-title {
        min-width: 0;
        overflow: hidden;
    }

    .rb-header-title h1 {
        font-size: 0.95em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .rb-header-title p {
        display: none;
    }

    /* Push actions to the right, show only the hamburger */
    .rb-header-actions {
        width: auto;
        margin-left: auto;
        flex-shrink: 0;
        flex-wrap: nowrap;
    }

    .rb-header-actions .btn-home,
    .rb-header-actions button:not(.rb-hamburger) { display: none; }

    /* Hamburger button */
    .rb-hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        background: transparent;
        border: 1.5px solid rgba(255,255,255,0.5);
        border-radius: 6px;
        padding: 7px 9px;
        cursor: pointer;
        position: relative;
        z-index: 1;
    }
    .rb-hamburger span {
        display: block;
        width: 18px;
        height: 2px;
        background: #fff;
        border-radius: 1px;
        transition: transform 0.22s ease, opacity 0.18s ease;
    }
    .rb-hamburger.open span:nth-child(1) { transform: rotate(45deg)  translate(5px, 5px);  }
    .rb-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0);               }
    .rb-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

    /* Dropdown panel — position:fixed escapes rb-wrapper's overflow:hidden */
    .rb-mobile-dropdown.open {
        display: flex;
        flex-direction: column;
        gap: 8px;
        position: fixed;
        top: 85px;
        left: 0;
        right: 0;
        background: #003d7a;
        z-index: 99;
        padding: 12px 16px 14px;
        box-shadow: 0 6px 20px rgba(0,0,0,0.3);
        border-bottom: 2px solid #0097a7;
        animation: rbDropIn 0.18s ease;
    }
    @keyframes rbDropIn {
        from { opacity: 0; transform: translateY(-6px); }
        to   { opacity: 1; transform: translateY(0);    }
    }
    .rb-mobile-dropdown .btn-home {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 10px 16px;
        font-size: 0.9em;
    }

    .btn-home {
        padding: 5px 10px;
        font-size: 0.78em;
    }
}

@media print {
    .rb-hamburger, .rb-mobile-dropdown { display: none !important; }
}

/* ── Mobile (≤ 1200px) ── */
@media (max-width: 1200px) {
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .header {
        padding: 20px 16px;
        text-align: left;
    }

    .header h1 {
        font-size: 1.4em;
        letter-spacing: 0.04em;
    }

    .header p {
        font-size: 0.95em;
    }

    .header::after {
        width: 60px;
        height: 60px;
    }

    .logo-container img {
        max-width: 180px;
    }

    .content {
        padding: 12px;
    }

    .content h2 {
        font-size: 1.1em;
    }

    .content h3 {
        font-size: 1em;
    }

    .mode-selector {
        flex-direction: column;
    }

    .mode-card {
        min-width: 100%;
        padding: 14px;
    }

    /* Forms */
    label {
        font-size: 0.8em;
    }

    input, select, textarea {
        font-size: 1em; /* prevent iOS zoom on focus */
        padding: 10px 12px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    /* Buttons */
    .btn {
        padding: 14px 0;
        font-size: 1em;
    }

    .btn-primary {
        width: 100%;
        padding: 14px;
    }

    .btn-back {
        bottom: 16px;
        left: 16px;
        padding: 12px 18px;
        font-size: 0.95em;
    }

    .help-button {
        top: 16px;
        right: 16px;
        padding: 10px 16px;
        font-size: 0.95em;
    }

    /* Modal */
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
        align-self: flex-end;
    }

    .modal-header {
        padding: 16px 20px;
        border-radius: 0;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 14px 16px;
        flex-direction: column-reverse;
        gap: 10px;
    }

    .modal-footer button {
        width: 100%;
    }

    /* Footer */
    footer {
        padding: 20px 14px;
        border-radius: 0;
    }

    footer .footer-info {
        flex-direction: column;
        gap: 4px;
    }

    footer .footer-divider {
        display: none;
    }

    /* Result grids */
    .result-grid {
        grid-template-columns: 1fr;
    }

    /* Privacy */
    .privacy-actions {
        flex-direction: column;
    }

    .privacy-actions button {
        width: 100%;
    }
}

/* ==============================================
   INFO ICON / TOOLTIP
   Used by: Alternator Sizing Tool and all other pages with .info-icon
   ============================================== */

.info-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--color-primary-medium, #004990), var(--color-accent-teal, #35c4b5));
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    margin-left: 6px;
    position: relative;
    z-index: 0;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}

.info-icon:hover {
    background: linear-gradient(135deg, var(--color-accent-teal, #35c4b5), var(--color-blue-deep, #003670));
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(53, 196, 181, 0.4);
    /* Lift above all sibling content so the tooltip is never clipped by adjacent elements */
    z-index: 9999;
}

.info-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    /* Place above the icon; shift up a bit further on hover */
    bottom: 125%;
    /* Center horizontally on the icon */
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--color-dark-text, #394a58), var(--color-medium-text, #5e6f7e));
    color: white;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm, 6px);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    white-space: normal;
    width: 280px;
    /* Never wider than 80 % of the viewport so it stays on-screen */
    max-width: min(280px, 80vw);
    box-shadow: 0 8px 24px rgba(0, 73, 144, 0.3);
    /* z-index is relative to the icon's own stacking context (z-index 9999 on hover) */
    z-index: 1;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    border: 1px solid rgba(53, 196, 181, 0.3);
}

.info-tooltip strong {
    color: white;
    font-weight: 700;
}

.info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--color-dark-text, #394a58);
}

.info-icon:hover .info-tooltip {
    visibility: visible;
    opacity: 1;
    bottom: 135%;
}

@media (max-width: 800px) {
    .info-tooltip {
        width: 220px;
        font-size: 12px;
        padding: 10px 12px;
    }
}
