/* ==========================================================
   Water Quality Checker – Feuille de style
   ========================================================== */

/* ---- Variables ---- */
:root {
    --wqc-green:       #80B926;
    --wqc-green-dark:  #4a9e4a;
    --wqc-orange:      #e07b20;
    --wqc-orange-light:#f5a623;
    --wqc-blue:        #1a6fb5;
    --wqc-blue-light:  #2a88d8;
    --wqc-text:        #222222;
    --wqc-text-muted:  #666666;
    --wqc-border:      #c8d8e8;
    --wqc-bg:          #ffffff;
    --wqc-bg-result:   #f8fafc;
    --wqc-radius:      8px;
    --wqc-radius-lg:   14px;
    --wqc-shadow:      0 2px 16px rgba(0,0,0,.07);
    --wqc-transition:  .25s ease;
    --wqc-bar-h:       52px;
    --wqc-track-bg:    #e5ecf4;
}

/* ---- Wrapper global ---- */
.wqc-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0;
    background: var(--wqc-bg);
    overflow: hidden;

    font-size: 15px;
    color: var(--wqc-text);
    max-width: 1280px;
    margin: 0 auto;
}

/* ---- Colonne formulaire ---- */
.wqc-form-col {
    flex: 0 0 460px;
    min-width: 280px;
    padding: 36px 32px 40px;
    background: var(--wqc-bg);
}

/* ---- Titre formulaire ---- */
.wqc-title {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 8px;
    color: var(--wqc-green);
}

.wqc-subtitle {
    font-size: .8rem;
    color: var(--wqc-blue);
    margin: 0 0 32px;
}

/* ---- Champs ---- */
.wqc-form-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.wqc-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: opacity var(--wqc-transition);
}
.wqc-field-group[aria-hidden="true"] {
    opacity: .45;
    pointer-events: none;
}
.wqc-field-group.wqc-active {
    opacity: 1;
    pointer-events: all;
}

.wqc-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--wqc-text-muted);
}

/* Input texte */
.wqc-input-wrap {
    position: relative;
}
.wqc-input {
    width: 100%;
    padding: 13px 44px 13px 16px !important;
    border: 2px solid var(--wqc-border) !important;
    border-radius: var(--wqc-radius) !important;
    font-size: 0.9em !important;;
    font-weight: 400 !important;;
    color: var(--wqc-blue) !important;;
    background: #fff;
    outline: none;
    transition: border-color var(--wqc-transition), box-shadow var(--wqc-transition);
    box-sizing: border-box;
}
.wqc-input:focus {
    border-color: var(--wqc-blue-light);
    box-shadow: 0 0 0 3px rgba(42,136,216,.15);
}
.wqc-input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    pointer-events: none;
}

/* Select */
.wqc-select-wrap {
    position: relative;
}
.wqc-select {
    width: 100%;
    padding: 13px 40px 13px 16px;
    border: 2px solid var(--wqc-border);
    border-radius: var(--wqc-radius);
    font-size: 0.9em;
    font-weight: 400;
    color: var(--wqc-blue);
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
    transition: border-color var(--wqc-transition), box-shadow var(--wqc-transition);
    box-sizing: border-box;
}
.wqc-select:focus {
    border-color: var(--wqc-blue-light);
    box-shadow: 0 0 0 3px rgba(42,136,216,.15);
}
.wqc-select:disabled {
    color: #aaa;
    background: #f5f7fa;
    cursor: default;
}
.wqc-select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--wqc-blue);
    pointer-events: none;
}

.wqc-hint {
    font-size: .78rem;
    color: var(--wqc-text-muted);
}

/* ---- Loader inline ---- */
.wqc-loader-inline {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    color: var(--wqc-text-muted);
}

/* ---- Alertes ---- */
.wqc-alert {
    border-radius: var(--wqc-radius);
    padding: 12px 16px;
    font-size: .88rem;
    line-height: 1.5;
}
.wqc-alert--error {
    background: #fff1f0;
    border: 1px solid #ffa39e;
    color: #cf1322;
}
.wqc-alert--info {
    background: #e6f4ff;
    border: 1px solid #91caff;
    color: #0958d9;
}

/* ---- Bouton principal ---- */
.wqc-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: var(--wqc-green);
    color: #fff;
    border: none;
    border-radius: var(--wqc-radius);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: .1em;
    cursor: pointer;
    transition: background var(--wqc-transition), transform .1s;
    margin-top: 6px;
}
.wqc-btn-primary:hover:not(:disabled) {
    background: var(--wqc-green-dark);
    transform: translateY(-1px);
}
.wqc-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}
.wqc-btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

/* ---- Séparateur vertical ---- */
.wqc-divider {
    width: 1px;
    align-self: stretch;
    background: linear-gradient(to bottom, transparent, var(--wqc-border) 15%, var(--wqc-border) 85%, transparent);
}

/* ---- Colonne résultats ---- */
.wqc-results-col {
    flex: 1 1 400px;
    min-width: 280px;
    padding: 36px 36px 40px;
}

/* ---- Placeholder ---- */
.wqc-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    text-align: center;
    color: var(--wqc-text-muted);
    gap: 14px;
}
.wqc-placeholder-icon {
    font-size: 3rem;
    opacity: .5;
    animation: wqc-float 3s ease-in-out infinite;
}
@keyframes wqc-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}
.wqc-placeholder p {
    font-size: .95rem;
    margin: 0;
    line-height: 1.6;
}

/* ---- Loader résultats ---- */
.wqc-results-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    gap: 16px;
    color: var(--wqc-text-muted);
    font-size: .9rem;
}

/* ---- Spinner ---- */
.wqc-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wqc-spin .7s linear infinite;
    flex-shrink: 0;
}
.wqc-spinner--lg {
    width: 36px;
    height: 36px;
    border-width: 3px;
    border-color: rgba(42,136,216,.2);
    border-top-color: var(--wqc-blue-light);
}
@keyframes wqc-spin {
    to { transform: rotate(360deg); }
}

/* ---- Résultats ---- */
.wqc-result-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--wqc-text);
    margin: 0 0 28px;
    line-height: 1.3;
}
.wqc-water-label {
    display: inline;
    font-weight: 800;
    font-size: 1.5rem;
    color: #d44000;
}

/* ---- Carte métrique ---- */
.wqc-metric-card {
    margin-bottom: 30px;
}
.wqc-metric-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 14px;
}
.wqc-color-orange { color: var(--wqc-orange); }
.wqc-color-blue   { color: var(--wqc-blue);   }

/* ---- Étiquettes d'échelle ---- */
.wqc-scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: .7rem;
    color: var(--wqc-text-muted);
    margin-bottom: 6px;
}
.wqc-scale-labels--ph {
    justify-content: space-between;
}

/* ---- Barre de progression ---- */
.wqc-bar-track {
    background: var(--wqc-track-bg);
    border-radius: 50px;
    overflow: hidden;
    height: var(--wqc-bar-h);
    position: relative;
}
.wqc-bar {
    height: 100%;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width .8s cubic-bezier(.34,1.3,.64,1);
    min-width: 60px;
}
.wqc-bar--orange { background: var(--wqc-orange); }
.wqc-bar--blue   { background: var(--wqc-blue);   }
.wqc-bar-value {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    white-space: nowrap;
    padding: 0 16px;
}

/* ---- Métadonnées ---- */
.wqc-meta {
    font-size: .8rem;
    color: var(--wqc-text-muted);
    margin: 10px 0 0;
    line-height: 1.7;
}
.wqc-meta strong {
    color: var(--wqc-text);
}

/* ---- Animation d'entrée des résultats ---- */
@keyframes wqc-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
#wqc-results-content {
    animation: wqc-fade-in .4s ease both;
}
.wqc-metric-card:nth-child(2) { animation: wqc-fade-in .4s .1s ease both; }
.wqc-metric-card:nth-child(3) { animation: wqc-fade-in .4s .22s ease both; }

/* ---- Responsive ---- */
@media (max-width: 680px) {
    .wqc-wrapper {
        flex-direction: column;
        border-radius: 0;
    }
    .wqc-form-col,
    .wqc-results-col {
        flex: none;
        width: 100%;
        padding: 24px 18px 28px;
    }
    .wqc-divider {
        width: 100%;
        height: 1px;
        background: linear-gradient(to right, transparent, var(--wqc-border) 15%, var(--wqc-border) 85%, transparent);
    }
    .wqc-scale-labels {
        font-size: .62rem;
    }
    .wqc-result-title {
        font-size: 1.15rem;
    }
}
