/**
 * FlixWater Water Hardness Lookup
 * Frontend styles
 */


/* ============================================================
   TOOL CONTAINER
   ============================================================ */

.fw-hardness-tool {
    --fw-primary: #1e6c64;
    --fw-primary-dark: #144d47;
    --fw-primary-light: #eef5f4;
    --fw-ink: #10262f;
    --fw-muted: #5f7075;
    --fw-border: #d6e1df;
    --fw-border-dark: #b9cbc8;
    --fw-white: #ffffff;
    --fw-error: #a94442;

    width: 100%;
    max-width: 760px;
    margin: 0 auto;

    color: var(--fw-ink);
    font-family: inherit;

    box-sizing: border-box;
}

.fw-hardness-tool *,
.fw-hardness-tool *::before,
.fw-hardness-tool *::after {
    box-sizing: border-box;
}


/* ============================================================
   FORM
   ============================================================ */

.fw-hardness-form {
    width: 100%;
}

.fw-hardness-label {
    display: block;

    margin: 0 0 9px;

    color: var(--fw-ink);

    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.fw-hardness-input-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}


/* ============================================================
   ZIP INPUT
   ============================================================ */

.fw-hardness-zip {
    display: block;

    width: 100%;
    min-width: 0;
    min-height: 50px;

    margin: 0;
    padding: 0 15px;

    border: 1px solid var(--fw-border-dark);
    border-radius: 5px;

    background: var(--fw-white);
    color: var(--fw-ink);

    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;

    box-shadow: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.fw-hardness-zip::placeholder {
    color: var(--fw-muted);
    opacity: 0.75;
}

.fw-hardness-zip:hover {
    border-color: var(--fw-primary);
}

.fw-hardness-zip:focus {
    outline: none;

    border-color: var(--fw-primary);

    box-shadow:
        0 0 0 3px rgba(30, 108, 100, 0.12);
}


/* ============================================================
   BUTTON
   ============================================================ */

.fw-hardness-submit {
    flex: 0 0 auto;

    min-height: 50px;

    margin: 0;
    padding: 0 22px;

    border: 1px solid var(--fw-primary);
    border-radius: 5px;

    background: var(--fw-primary);
    color: var(--fw-white);

    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        opacity 0.15s ease;
}

.fw-hardness-submit:hover {
    background: var(--fw-primary-dark);
    border-color: var(--fw-primary-dark);
}

.fw-hardness-submit:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(30, 108, 100, 0.18);
}

.fw-hardness-submit:disabled {
    cursor: wait;
    opacity: 0.65;
}


/* ============================================================
   HELP TEXT
   ============================================================ */

.fw-hardness-help {
    margin: 9px 0 0;

    color: var(--fw-muted);

    font-size: 13px;
    line-height: 1.5;
}


/* ============================================================
   RESULT CONTAINER
   ============================================================ */

.fw-hardness-result {
    width: 100%;
    margin-top: 28px;
}

.fw-hardness-result:empty {
    display: none;
}


/* ============================================================
   RESULT CARD
   ============================================================ */

.fw-hardness-card {
    width: 100%;

    padding: 26px 28px;

    border: 1px solid var(--fw-border);
    border-radius: 8px;

    background: var(--fw-white);
}


/* ============================================================
   RESULT LABEL
   ============================================================ */

.fw-hardness-result-label {
    margin: 0 0 7px;

    color: var(--fw-muted);

    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}


/* ============================================================
   HARDNESS VALUE
   ============================================================ */

.fw-hardness-value {
    margin: 0;

    color: var(--fw-primary-dark);

    font-size: 38px;
    font-weight: 700;
    line-height: 1.15;
}


/* ============================================================
   LOCATION
   ============================================================ */

.fw-hardness-location {
    margin: 8px 0 22px;

    color: var(--fw-muted);

    font-size: 15px;
    line-height: 1.5;
}


/* ============================================================
   RESULT DETAILS
   ============================================================ */

.fw-hardness-details {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 18px 28px;

    margin: 0;
    padding-top: 20px;

    border-top: 1px solid var(--fw-border);
}

.fw-hardness-detail {
    margin: 0;
}

.fw-hardness-detail-label {
    display: block;

    margin-bottom: 4px;

    color: var(--fw-muted);

    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.fw-hardness-detail-value {
    display: block;

    color: var(--fw-ink);

    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
}


/* ============================================================
   SOURCE
   ============================================================ */

.fw-hardness-source {
    margin-top: 22px;
    padding-top: 18px;

    border-top: 1px solid var(--fw-border);
}

.fw-hardness-source-label {
    margin: 0 0 5px;

    color: var(--fw-muted);

    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.fw-hardness-source a {
    color: var(--fw-primary-dark);
    font-size: 14px;
    line-height: 1.5;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.fw-hardness-source a:hover {
    text-decoration-thickness: 2px;
}


/* ============================================================
   NOT FOUND
   ============================================================ */

.fw-hardness-not-found {
    padding: 22px 24px;

    border: 1px solid var(--fw-border);
    border-radius: 8px;

    background: var(--fw-primary-light);
}

.fw-hardness-not-found-title {
    margin: 0 0 7px;

    color: var(--fw-ink);

    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.fw-hardness-not-found-text {
    margin: 0;

    color: var(--fw-muted);

    font-size: 14px;
    line-height: 1.6;
}


/* ============================================================
   ERROR
   ============================================================ */

.fw-hardness-error {
    padding: 18px 20px;

    border: 1px solid rgba(169, 68, 66, 0.25);
    border-radius: 8px;

    background: #faf3f3;
    color: var(--fw-error);

    font-size: 14px;
    line-height: 1.5;
}


/* ============================================================
   LOADING
   ============================================================ */

.fw-hardness-loading {
    display: flex;
    align-items: center;
    gap: 10px;

    color: var(--fw-muted);

    font-size: 14px;
    line-height: 1.5;
}

.fw-hardness-loading-spinner {
    width: 18px;
    height: 18px;

    border: 2px solid var(--fw-border);
    border-top-color: var(--fw-primary);

    border-radius: 50%;

    animation: fw-hardness-spin 0.7s linear infinite;
}

@keyframes fw-hardness-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 600px) {

    .fw-hardness-input-row {
        flex-direction: column;
        gap: 10px;
    }

    .fw-hardness-submit {
        width: 100%;
    }

    .fw-hardness-card {
        padding: 22px 20px;
    }

    .fw-hardness-value {
        font-size: 32px;
    }

    .fw-hardness-details {
        grid-template-columns: 1fr;
        gap: 15px;
    }

}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    .fw-hardness-zip,
    .fw-hardness-submit {
        transition: none;
    }

    .fw-hardness-loading-spinner {
        animation: none;
    }

}