/* ==========================================
   UFIND MARKETPLACE THEME
========================================== */

* {
    box-sizing: border-box;
}

:root {
    --ufind-blue: #174a9c;
    --ufind-blue-hover: #123f86;
    --ufind-header: #0b3159;
    --ufind-border: #e7ebf3;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: #f6f7fb;
    color: #172033;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

body.image-background-page {
    background-color: #f6f7fb;
}

.background-slide {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-position: center top;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease-in-out;
}

.background-slide.is-visible {
    opacity: 1;
}

a {
    color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(37, 132, 238, 0.45);
    outline-offset: 3px;
}

/* ==========================================
   HEADER
========================================== */

header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--ufind-header);
    border-bottom: 1px solid #082847;
}

.brand-bar {
    width: 100%;
    margin: 0 auto;
    min-height: 88px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

/* Keep the homepage logo centered with admin access at the right. */
.brand-bar-with-admin {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
}

.brand-bar-with-admin .brand-logo {
    grid-column: 2;
}

.header-actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-action-link {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 9px 18px;
    border: 1px solid #ffcc00;
    border-radius: 999px;
    background-color: #ffcc00;
    color: var(--ufind-header);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.header-action-link:hover {
    background-color: #e6b800;
    border-color: #e6b800;
}

@media (max-width: 600px) {
    .brand-bar-with-admin {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .brand-bar-with-admin .brand-logo {
        grid-column: 1;
        justify-self: start;
    }

    .brand-bar-with-admin .brand-logo img {
        width: min(27vw, 100px);
        height: auto;
    }

    .header-actions {
        grid-column: 2;
        gap: 6px;
    }

    .header-action-link {
        padding: 8px 9px;
        font-size: 0.78rem;
    }
}

.brand-logo img {
    display: block;
    width: auto;
    max-width: min(260px, calc(100vw - 48px));
    height: 58px;
    border-radius: 2px;
}

/* ==========================================
   LAYOUT
========================================== */

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 36px;
    flex: 1;
}

section,
.referral-form {
    width: 100%;
    max-width: 920px;
    margin: 0 auto 22px;
}

section {
    background-color: rgba(255, 255, 255, 0.92);
    border: 1px solid #e2e6ef;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(20, 35, 60, 0.06);
}

.image-background-page section,
.image-background-page .referral-form {
    border-color: rgba(226, 230, 239, 0.82);
    box-shadow: 0 18px 40px rgba(10, 35, 70, 0.12);
}

h2 {
    margin: 0 0 12px;
    color: #172033;
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    line-height: 1.15;
}

h3 {
    color: #172033;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--ufind-blue);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ==========================================
   HERO
========================================== */

.hero {
    max-width: 920px;
    min-height: 300px;
    display: grid;
    align-content: center;
    justify-items: center;
    text-align: center;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 249, 255, 0.86));
    padding: 44px 28px;
}

.hero h2 {
    max-width: 720px;
}

.hero p {
    max-width: 720px;
    margin: 0 auto 24px;
    color: #526174;
    font-size: 1.05rem;
}

/* ==========================================
   UFIND GOAL
========================================== */

.goal-section {
    background: linear-gradient(135deg, #ffffff, #f2f6fc);
    position: relative;
    overflow: hidden;
}

.goal-section h2 { color: var(--ufind-header); }

.goal-criteria {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.goal-criteria li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    border: 1px solid #dfe7f2;
    border-radius: 8px;
    background: #ffffff;
}

.goal-icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--ufind-blue);
    color: #ffffff;
}

.goal-icon svg { width: 24px; height: 24px; }
.goal-criteria h3 { margin: 0 0 6px; font-size: 1rem; color: var(--ufind-blue); }
.goal-criteria p { margin: 0; color: #526174; line-height: 1.6; }

@media (max-width: 760px) {
    .goal-criteria { grid-template-columns: 1fr; }
    .goal-criteria li { padding: 16px; flex-direction: row; }
}

/* ==========================================
   BUTTONS
========================================== */

button,
.button {
    display: inline-block;
    min-height: 44px;
    background-color: var(--ufind-blue);
    color: #ffffff;
    border: 1px solid var(--ufind-blue);
    border-radius: 999px;
    padding: 12px 22px;
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    background-color: var(--ufind-blue-hover);
    border-color: var(--ufind-blue-hover);
}

/* ==========================================
   CARDS
========================================== */

.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.step {
    background-color: #f8fafc;
    border: 1px solid #e2e6ef;
    border-radius: 8px;
    padding: 20px;
}

.step h3 {
    margin-top: 0;
    color: var(--ufind-blue);
    font-size: 1rem;
}

.approved-vendors-message {
    margin: 0;
    color: #526174;
}

.approved-vendors-marquee {
    overflow: hidden;
    margin-top: 20px;
}

.approved-vendors-marquee:hover .approved-vendors-track {
    animation-play-state: paused;
}

.approved-vendors-track {
    display: flex;
    width: max-content;
    animation: approved-vendors-scroll 32s linear infinite;
}

.approved-vendors-list {
    display: flex;
    flex: 0 0 auto;
    gap: 14px;
    width: max-content;
    margin: 0;
    /* Include the final gap in each copy so the -50% loop stays seamless. */
    padding: 0 14px 0 0;
    list-style: none;
}

.approved-vendors-list li {
    flex: 0 0 auto;
    width: min(280px, calc(100vw - 96px));
    overflow-wrap: anywhere;
    padding: 16px;
    border: 1px solid #dfe7f2;
    border-radius: 8px;
    background: #f8fafc;
}

.approved-vendors-list strong {
    color: var(--ufind-header);
}

.approved-vendors-list p {
    margin: 6px 0 0;
    color: #526174;
}

@keyframes approved-vendors-scroll {
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .approved-vendors-track { width: auto; animation: none; }
    .approved-vendors-list { width: 100%; flex-wrap: wrap; padding: 0; }
    .approved-vendors-list[aria-hidden="true"] { display: none; }
    .approved-vendors-list li { flex-basis: min(280px, 100%); }
}

.faq-item {
    border-top: 1px solid var(--ufind-border);
}

.faq-item summary {
    padding: 16px 4px;
    color: var(--ufind-blue);
    font-weight: 800;
    cursor: pointer;
}

.faq-item summary:focus-visible {
    outline: 3px solid rgba(18, 63, 140, 0.3);
    outline-offset: 2px;
}

.faq-item p {
    margin: 0;
    padding: 0 4px 16px;
    color: #526174;
}

.pending {
    display: inline-block;
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 0.88rem;
    font-weight: 800;
    background-color: #fff6d8;
    color: #81600b;
}

/* ==========================================
   FORM
========================================== */

.form-intro {
    max-width: 760px;
    border-radius: 8px;
    margin-bottom: 22px;
    box-shadow: 0 10px 30px rgba(20, 35, 60, 0.06);
}

.form-intro h2 {
    font-size: clamp(1.6rem, 3vw, 2.15rem);
}

.required-text,
.required {
    color: #d93025;
}

.referral-form {
    max-width: 760px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 0;
    padding: 28px;
    background-color: #ffffff;
    border: 1px solid #e2e6ef;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(20, 35, 60, 0.08);
}

.form-card {
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.form-card-wide,
.form-actions {
    grid-column: 1 / -1;
}

.form-card label {
    display: block;
    color: #172033;
    font-size: 0.98rem;
    font-weight: 800;
}

.form-card input,
.form-card textarea {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 13px 14px;
    border: 1px solid #d9dfeb;
    border-radius: 8px;
    background-color: #ffffff;
    color: #172033;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1rem;
}

.form-card input:focus,
.form-card textarea:focus {
    border-color: var(--ufind-blue);
    outline: 3px solid rgba(18, 63, 140, 0.16);
}

.form-card textarea {
    min-height: 120px;
    resize: vertical;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 8px;
    padding-top: 22px;
    border-top: 1px solid #e2e6ef;
}

.form-actions a {
    color: var(--ufind-blue);
    font-weight: 800;
    text-decoration: none;
}

.form-actions a:hover {
    text-decoration: underline;
}

/* ==========================================
   SUCCESS
========================================== */

.success .pending {
    padding: 10px 24px;
    font-size: 1.05rem;
    min-width: 120px;
}

.success {
    max-width: 760px;
    padding-top: 58px;
    padding-bottom: 58px;
    text-align: center;
}

.checkmark {
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    background-color: #ddf7e8;
    color: #17613a;
    border-radius: 50%;
    font-size: 2.6rem;
    font-weight: 900;
}

.success-buttons {
    width: 100%;
    margin: 24px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.success-buttons .button {
    min-width: 220px;
}

/* ==========================================
   FOOTER
========================================== */

footer {
    background-color: var(--ufind-header);
    color: #ffffff;
    border-top: 1px solid #082847;
    padding: 24px 20px;
    text-align: center;
}

footer p {
    margin: 0;
}

/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 900px) {
    .brand-bar {
        padding: 14px 20px;
    }

    .steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 600px) {
    body {
        font-size: 16px;
    }

    body.image-background-page {
        background-attachment: scroll;
        background-position: center top;
    }

    main {
        width: calc(100% - 16px);
        padding: 16px 0 28px;
    }

    .brand-bar {
        width: 100%;
        min-height: 72px;
        padding: 12px;
    }

    .brand-logo img {
        height: 42px;
    }

    section {
        margin-bottom: 16px;
        padding: 18px;
    }

    .referral-form {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 18px;
    }

    .form-intro {
        margin-bottom: 16px;
    }

    h2 {
        font-size: 1.7rem;
    }

    .hero {
        min-height: auto;
        padding: 32px 18px;
    }

    .hero p {
        font-size: 1rem;
    }

    .steps {
        grid-template-columns: 1fr;
    }

    .pending {
        max-width: 100%;
        white-space: normal;
    }

    button,
    .button {
        width: 100%;
    }

    .form-actions,
    .success-buttons {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .success-buttons .button {
        min-width: 0;
    }

    .form-actions a {
        min-height: 44px;
        display: grid;
        place-items: center;
    }
}

@media (max-width: 380px) {
    .brand-logo img {
        height: 36px;
    }

    section,
    .referral-form {
        padding: 16px;
    }

    h2 {
        font-size: 1.5rem;
    }
}
