/* ============================================================
   tools.css — Styles spécifiques aux outils interactifs
   Inclus uniquement sur les pages avec $page_has_tool = true
   Dépend des variables définies dans style.css
   ============================================================ */

/* ── Tool section ───────────────────────────────────────────── */
.tool-section {
    padding: var(--space-2xl) 0;
    background: var(--color-bg-alt);
}

.tool-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
    max-width: 680px;
    margin: 0 auto;
    padding: inherit;
}

/* ── Tabs ───────────────────────────────────────────────────── */
.tool-tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    background: var(--color-bg-alt);
}

.tool-tab {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    background: none;
    border: none;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s, background .15s;
    text-align: center;
}

.tool-tab:hover {
    color: var(--color-secondary);
    background: rgba(46,109,164,.05);
}

.tool-tab--active {
    color: var(--color-secondary);
    border-bottom-color: var(--color-secondary);
    background: #fff;
}

/* ── Panel ──────────────────────────────────────────────────── */
.tool-panel {
    padding: var(--space-xl);
}

/* ── Form ───────────────────────────────────────────────────── */
.tool-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

@media (min-width: 480px) {
    .tool-form {
        grid-template-columns: 1fr 1fr;
    }
}

.tool-form__group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.tool-form__label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.tool-form__input,
.tool-form__select {
    height: 52px;
    padding: 0 var(--space-md);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font: inherit;
    font-size: 1.1rem;
    color: var(--color-text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}

.tool-form__input:focus,
.tool-form__select:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(46,109,164,.15);
}

.tool-form__input::placeholder {
    color: #aab4c4;
}

.tool-form__select {
    cursor: pointer;
    appearance: none;
    -webkit-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 fill='none' stroke='%232e6da4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

/* ── Results ────────────────────────────────────────────────── */
.tool-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

@media (max-width: 360px) {
    .tool-results {
        grid-template-columns: 1fr;
    }
}

.tool-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-md);
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    gap: var(--space-xs);
}

.tool-result--highlight {
    background: var(--color-accent);
    border-color: var(--color-secondary);
}

.tool-result__label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--color-text-light);
}

.tool-result__value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-mono);
    line-height: 1.2;
}

.tool-result--highlight .tool-result__value {
    color: var(--color-secondary);
    font-size: 1.9rem;
}

/* ── Extended tool (3+ results) ─────────────────────────────── */
.tool-results--triple {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 480px) {
    .tool-results--triple {
        grid-template-columns: 1fr;
    }
}

/* ── Tool note ──────────────────────────────────────────────── */
.tool-note {
    margin-top: var(--space-md);
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-style: italic;
}

/* ── Tool wide (full width card) ────────────────────────────── */
.tool-card--wide {
    max-width: 900px;
}
