﻿/* ============================================================
   Submit Testimonial page (Home/SubmitTestimonial) - revamp.
   Matches the Feedback page: plain page head (same component as
   RealtorIndex .rlt-head / HomeCounties .pbc-head) + a single centered
   white card holding the native testimonial form with an interactive
   gold star rating and a clean upload zone.
   Scoped under .tst-page so nothing leaks to other pages. No
   font-family declarations - all text inherits the site font.

   This is our OWN native MVC form (posts to Home/SubmitTestimonial,
   multipart, binds to the Testimonial model + HttpPostedFileBase ImageName).
   The markup is restructured only for layout - every field binding, name,
   id, required flag, the file input (#ImageName), and the submit behavior
   are unchanged. The real Rating <select> (id=Rating, .ratingList) is kept
   and visually hidden (NOT display:none, so jQuery Validate still checks
   it); the star overlay writes into it, so the SAME 1-5 value is submitted.
   ============================================================ */

.tst-page {
    --tst-navy: #244565;
    --tst-teal: #30caa0;
    --tst-heading: #252525;
    --tst-text: #707070;
    --tst-border: #e8e4dc;
    --tst-input-border: #d8dee6;
    --tst-star: #f5b731;
    background: #F5F6F7;
    color: var(--tst-text);
    margin: 0 !important;
}

/* ---------- Page head (values from .pbc-head / .rlt-head) ---------- */
.tst-page .tst-head {
    position: relative;
    padding: 40px 24px 26px;
    text-align: center;
}

    .tst-page .tst-head h1 {
        position: relative;
        font-size: clamp(1.7rem, 3.4vw, 2.15rem);
        font-weight: 800;
        line-height: 1.15;
        margin: 0;
        padding-bottom: 14px;
        color: #333333;
        text-wrap: balance;
        text-transform: capitalize;
    }

        .tst-page .tst-head h1::after {
            content: '';
            position: absolute;
            left: 50%;
            bottom: 0;
            transform: translateX(-50%);
            width: 60px;
            height: 3px;
            background: var(--tst-teal);
            border-radius: 2px;
        }

/* ---------- Card ---------- */
.tst-page .tst-wrap {
    max-width: 700px;
    margin: 0 auto;
    padding: 8px 24px 80px;
}

.tst-page .tst-card {
    background: #ffffff;
    border: 1px solid var(--tst-border);
    border-top: 4px solid var(--tst-teal);
    border-radius: 15px;
    padding: 44px;
}

/* ---------- Fields ---------- */
.tst-page .form-group {
    margin-bottom: 20px;
}

.tst-page .tst-card label.control-label {
    display: block !important;
    float: none !important;
    width: auto !important;
    text-align: left !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--tst-heading) !important;
    margin-bottom: 7px !important;
    padding: 0 !important;
}

.tst-page .tst-card .redAsterik {
    color: #e0554f !important;
    font-weight: 400;
}

/* The "On a scale of 1-5..." helper line under the Rating label. */
.tst-page .tst-rate-hint {
    font-size: 14px;
    color: var(--tst-text);
    margin: -2px 0 12px;
}

/* Inputs / select / textarea (bootstrap .form-control from the helpers). */
.tst-page .tst-card input.form-control,
.tst-page .tst-card select.form-control,
.tst-page .tst-card textarea.form-control {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    border: 1.5px solid var(--tst-input-border) !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    font-size: 15px !important;
    color: var(--tst-heading) !important;
    background-color: #fff !important;
    box-shadow: none !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .tst-page .tst-card input.form-control:focus,
    .tst-page .tst-card select.form-control:focus,
    .tst-page .tst-card textarea.form-control:focus {
        outline: none !important;
        border-color: var(--tst-teal) !important;
        box-shadow: 0 0 0 3px rgba(48, 202, 160, .18) !important;
    }

.tst-page .tst-card textarea.form-control {
    min-height: 130px !important;
    resize: vertical !important;
}

/* Styled dropdown with a custom chevron (the "I am a" select). */
.tst-page .tst-card select.form-control {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23707070'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px !important;
    padding-right: 40px !important;
}

/* Two-column row (Name + "I am a"). */
.tst-page .tst-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Validation messages + summary. */
.tst-page .text-danger,
.tst-page .field-validation-error,
.tst-page .validation-summary-errors {
    display: block;
    color: #dc3545 !important;
    font-size: 14px;
    margin-top: 6px;
}

/* No gap under a field while its message span is empty. */
.tst-page .field-validation-valid {
    display: none;
}

/* ---------- Star rating (overlay driving the hidden select) ---------- */
/* Visually hidden but still laid out, so jQuery Validate (which skips
   :hidden fields) validates it and shows the required message. */
.tst-page .tst-card select.form-control.tst-rate-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    border: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

/* Stars + the "Good" / "Excellent!" label on one line, so no empty
   reserved row sits between the stars and the validation message. */
.tst-page .tst-rate-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 14px;
    row-gap: 4px;
}

.tst-page .tst-stars {
    display: flex;
    gap: 8px;
}

.tst-page .tst-star {
    width: 38px;
    height: 38px;
    cursor: pointer;
    border-radius: 4px;
    transition: transform .1s ease;
}

    .tst-page .tst-star:hover {
        transform: scale(1.15);
    }

    .tst-page .tst-star:focus-visible {
        outline: 2px solid var(--tst-navy);
        outline-offset: 2px;
    }

    .tst-page .tst-star svg {
        display: block;
        width: 100%;
        height: 100%;
        fill: #e2e2e2;
        transition: fill .12s ease;
    }

    .tst-page .tst-star.on svg {
        fill: var(--tst-star);
    }

.tst-page .tst-rate-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--tst-navy);
}

/* ---------- Upload zone (wraps the real #ImageName file input) ---------- */
.tst-page .tst-upload {
    position: relative;
    display: block;
    border: 1.5px dashed var(--tst-input-border);
    border-radius: 12px;
    padding: 26px;
    text-align: center;
    background: #fafbfc;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
    margin: 0 !important;
}

    .tst-page .tst-upload:hover {
        border-color: var(--tst-teal);
        background: #f2fcf8;
    }

    .tst-page .tst-upload:focus-within {
        border-color: var(--tst-teal);
        outline: 2px solid var(--tst-navy);
        outline-offset: 2px;
    }

    .tst-page .tst-upload svg {
        width: 32px;
        height: 32px;
        fill: var(--tst-teal);
        margin-bottom: 8px;
    }

.tst-page .tst-ut {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--tst-heading);
    margin-bottom: 3px;
}

.tst-page .tst-us {
    display: block;
    font-size: 14px;
    color: var(--tst-text);
}

.tst-page .tst-filename {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tst-navy);
    word-break: break-word;
}

/* Hide the raw file input visually but keep it focusable / keyboard
   operable (the wrapping label also opens it on click). */
.tst-page .tst-file-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    border: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

/* Keep the hidden helper fields hidden (Backlink group, mirror textbox). */
.tst-page .d-none {
    display: none !important;
}

/* ---------- Submit ----------
   The inline background (ViewBag.SecondaryColor, set in Admin) wins when
   present; teal is the fallback. Hover darkens whichever color is active. */
.tst-page .tst-submit {
    background: var(--tst-teal) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 15px 48px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer;
    margin-top: 6px;
    transition: filter .15s ease;
}

    .tst-page .tst-submit:hover {
        filter: brightness(.92);
    }

    .tst-page .tst-submit:focus-visible {
        outline: 2px solid var(--tst-navy);
        outline-offset: 3px;
    }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .tst-page .tst-head {
        padding: 32px 20px 22px;
    }

    .tst-page .tst-wrap {
        padding: 4px 16px 60px;
    }

    .tst-page .tst-card {
        padding: 28px 20px;
    }

    .tst-page .tst-row2 {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .tst-page .tst-upload {
        padding: 20px 16px;
    }

    .tst-page .tst-submit {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tst-page * {
        transition: none !important;
    }
}
