/* Find a Roommate page — built on the project's Tailwind theme + component classes */

/* ---------- Hero ---------- */
.roommate-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, #E9F1FF 0%, #F7ECE8 55%, #FBE3DA 100%);
}

.roommate-eyebrow {
    letter-spacing: 0.14em;
}

.roommate-highlight {
    color: var(--bs-primary);
}

/* Overlapping avatar row */
.roommate-avatars {
    display: flex;
    align-items: center;
}

/* On mobile the avatar row renders a second time, below the quick-start form;
   the copy inside the text column is hidden there and swapped at the lg breakpoint. */
.roommate-avatars--mobile {
    margin-top: 0.5rem;
}

.roommate-avatars--desktop {
    display: none;
}

@media only screen and (min-width: 1024px) {
    .roommate-avatars--desktop {
        display: flex;
    }

    .roommate-avatars--mobile {
        display: none;
    }
}

.space-p-top-find {
    padding-top: 144px;
}

.roommate-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bs-white);
    box-shadow: 0 6px 16px rgba(18, 34, 60, 0.15);
    margin-left: -18px;
    flex: none;
}

.roommate-avatar:first-child {
    margin-left: 0;
}

.roommate-avatar--blue {
    outline: 3px solid var(--bs-secondary);
}

.roommate-avatar--pink {
    outline: 3px solid var(--bs-primary);
}

/* Quick-start form card */
.roommate-quick-form {
    position: relative;
    background: var(--bs-white);
    border-radius: var(--bs-border-radius-xl);
    box-shadow: 0 20px 60px rgba(18, 34, 60, 0.12);
    padding: 2rem;
    overflow: hidden;
}

.roommate-quick-form::before {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--primary-gradient-v2);
    opacity: 0.18;
}

@media only screen and (min-width: 768px) {
    .roommate-quick-form {
        padding: 2.5rem;
    }
}

/* Phones: tighten the hero so the form's submit button lands above the fold */
@media only screen and (max-width: 767px) {
    .space-p-top-find {
        padding-top: 126px;
    }

    .roommate-quick-form {
        padding: 1.5rem;
    }

    .roommate-quick-form .form-label {
        margin-bottom: 0.5rem;
    }
}

/* ---------- How it works ---------- */
.process-card {
    height: 100%;
}

.process-card__image-wrap {
    position: relative;
    border-radius: var(--bs-border-radius-xl);
    overflow: hidden;
    box-shadow: var(--bs-box-shadow);
}

.process-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: 50% 28%;
}

.process-badge-number {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-white);
    font-weight: 700;
    font-family: var(--secondary-fontfamily);
    box-shadow: 0 8px 18px rgba(18, 34, 60, 0.25);
}

.process-badge-icon {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 8px 18px rgba(18, 34, 60, 0.18);
}

.process-badge-icon--blue {
    background: #EAF1FB;
    color: var(--bs-secondary);
}

.process-badge-icon--pink {
    background: #FDEDEB;
    color: var(--bs-primary);
}

.process-card__body {
    padding-top: 1.25rem;
}

.process-card__eyebrow {
    letter-spacing: 0.1em;
}

/* Closing CTA band */
.roommate-closing {
    background: var(--secondary-gradient);
    border-radius: var(--bs-border-radius-xl);
    color: var(--bs-white);
}

.roommate-closing h2,
.roommate-closing h3 {
    color: var(--bs-white);
}

/* Quiz modal */
.quiz-modal {
    width: 100%;
    max-width: calc(100vw - 2rem);
}

@media only screen and (min-width: 576px) {
    .quiz-modal {
        max-width: 560px;
    }
}

.quiz-modal .modal-content {
    padding: 1.5rem;
    overflow-wrap: break-word;
    border-radius: 1.5rem;
    box-shadow: 0 24px 60px rgba(18, 34, 60, 0.18);
    border: none;
    /* The steps are taller than a phone: the questions scroll between the
       progress bar and Back/Continue, which stay in view. */
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
}

@media only screen and (min-width: 576px) {
    .quiz-modal .modal-content {
        max-height: calc(100dvh - 3.5rem);
    }
}

.quiz-modal__screen {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.quiz-modal__body {
    /* Relative, so the visually hidden inputs and labels inside (absolutely
       positioned) scroll with it; otherwise they sit below it and make the
       whole modal scroll, header and all. */
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Room for focus rings and the pills' borders at the edges. */
    margin: 0 -0.5rem;
    padding: 0 0.5rem 0.5rem;
}

.quiz-modal__body:focus,
.quiz-question__heading:focus {
    outline: none;
}

@media only screen and (min-width: 576px) {
    .quiz-modal .modal-content {
        padding: 2rem;
    }
}

@media only screen and (min-width: 768px) {
    .quiz-modal .modal-content {
        padding: 2.5rem;
    }
}

.quiz-modal .abs-close {
    right: 1rem;
    top: 1rem;
    border-color: rgba(var(--primary-color-rgb), 0.12);
    color: var(--bs-primary);
}

.quiz-modal .abs-close:hover {
    background-color: rgba(var(--primary-color-rgb), 0.2);
    border-color: rgba(var(--primary-color-rgb), 0.2);
    color: var(--bs-primary);
    filter: none;
}

.quiz-modal__title {
    color: var(--bs-secondary);
    font-family: var(--secondary-fontfamily);
    font-weight: 700;
    letter-spacing: 0.02em;
    padding-right: 2.5rem;
}

.quiz-question__heading {
    font-family: var(--secondary-fontfamily);
    letter-spacing: -0.01em;
    font-weight: 700;
}

.quiz-question__helper {
    color: var(--bs-emphasis-color);
    font-weight: 600;
}

.quiz-answers {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.25rem;
    width: 100%;
}

.quiz-answer {
    display: block;
    width: 100%;
}

/* Hidden but still in the tab order, so the answers can be picked with the
   keyboard; the control beside it shows the focus. */
.quiz-answer input,
.quiz-pill input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.quiz-answer input:focus-visible ~ .quiz-answer__control,
.quiz-pill input:focus-visible ~ .quiz-pill__control {
    outline: 2px solid var(--bs-secondary);
    outline-offset: 2px;
}

.quiz-answer__control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: var(--btn-size);
    padding: 0.8rem 1.1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    color: #142d52;
    font-weight: 600;
    white-space: normal;
    text-align: left;
    line-height: 1.35;
    cursor: pointer;
    transition: all var(--default-animation-time) ease-in-out;
}

.quiz-answer__radio {
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--bs-border-color-translucent);
    position: relative;
}

.quiz-answer__control:hover {
    border-color: var(--bs-primary);
}

.quiz-answer input:checked~.quiz-answer__control {
    border-color: var(--bs-primary);
    background-color: rgba(var(--primary-color-rgb), 0.08);
    color: var(--bs-dark);
    font-weight: 700;
}

.quiz-answer input:checked~.quiz-answer__control .quiz-answer__radio {
    border-color: var(--bs-primary);
}

.quiz-answer input:checked~.quiz-answer__control .quiz-answer__radio::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--bs-primary);
}

.quiz-modal__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--bs-border-color);
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
    flex: none;
}

.quiz-modal__actions .btn-link {
    margin-right: auto;
    color: var(--bs-primary);
    font-weight: 500;
    text-decoration: none;
}

.quiz-modal__actions .btn-link:hover,
.quiz-modal__actions .btn-link:active {
    color: var(--bs-primary);
    text-decoration: none;
    background-color: rgba(var(--primary-color-rgb), 0.08);
}

.quiz-completion {
    text-align: center;
    padding: 1rem 0;
}
/* ---------- The steps' questions ---------- */
.quiz-question {
    margin: 1.75rem 0 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.quiz-question__legend {
    display: block;
    padding: 0;
    font-family: var(--secondary-fontfamily);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.35;
    color: var(--bs-dark);
}

.quiz-question__hint {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: var(--bs-secondary-color, #6c757d);
}

.quiz-field {
    margin-top: 0.75rem;
}

.quiz-field__prompt {
    display: block;
    margin: 0 0 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #142d52;
}

/* Choices: pills that wrap, a radio or a tick box under each. */
.quiz-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quiz-pill {
    display: inline-flex;
    max-width: 100%;
    margin: 0;
}

.quiz-pill__control {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.45rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    color: #142d52;
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.3;
    cursor: pointer;
    transition: all var(--default-animation-time) ease-in-out;
}

.quiz-pill__control:hover {
    border-color: var(--bs-primary);
}

.quiz-pill input:checked ~ .quiz-pill__control {
    border-color: var(--bs-primary);
    background-color: rgba(var(--primary-color-rgb), 0.12);
    color: var(--bs-dark);
}

.quiz-pill input:checked ~ .quiz-pill__control::before {
    content: "\2713";
    margin-right: 0.4rem;
    color: var(--bs-primary);
    font-weight: 700;
}

.quiz-pill input:disabled ~ .quiz-pill__control {
    cursor: default;
    opacity: 0.7;
}

/* Flexible / Important / Deal breaker: a smaller row under its question. */
.quiz-field--importance {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    margin-top: 0.6rem;
}

.quiz-field--importance > div {
    display: contents;
}

.quiz-field--importance .quiz-field__prompt {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--bs-secondary-color, #6c757d);
}

.quiz-field--importance .quiz-pills {
    gap: 0.35rem;
}

.quiz-field--importance .quiz-pill__control {
    min-height: 2rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
}

.quiz-field--importance .quiz-pill input:checked ~ .quiz-pill__control {
    border-color: var(--bs-secondary);
    background-color: rgba(var(--secondary-color-rgb), 0.08);
}

.quiz-field--importance .quiz-pill input:checked ~ .quiz-pill__control::before {
    color: var(--bs-secondary);
}

.quiz-field--importance .quiz-error {
    width: 100%;
}

/* Typed answers */
.quiz-money {
    position: relative;
    max-width: 12rem;
}

.quiz-money__sign {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #142d52;
    font-weight: 600;
    pointer-events: none;
}

.quiz-money .form-control {
    padding-left: 2rem;
}

.quiz-number {
    max-width: 6rem;
}

/* A choice drawn as a select (the rental terms). room-finder.css pads it top
   and bottom as it pads the inputs, which cut a select's text off: the
   inputs' 48px with no padding there centres it, with room for the arrow. */
.quiz-select {
    max-width: 20rem;
    height: 3rem;
    padding: 0 2.25rem 0 1.25rem;
}

/* "Choose one" reads as a placeholder, like the inputs'. */
.quiz-select--empty {
    color: rgba(0, 0, 0, 0.45);
}

.quiz-select--empty option {
    color: var(--bs-black);
}

/* Adults and children are one question: their boxes sit side by side. */
.quiz-field--count {
    display: inline-block;
    vertical-align: top;
    margin-right: 1.25rem;
}

.quiz-date {
    max-width: 14rem;
}

.quiz-note {
    min-height: 5.5rem;
    resize: vertical;
}

.quiz-error {
    margin: 0.4rem 0 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #c0392b;
}

.quiz-error__dismiss {
    margin-left: 0.5rem;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
}

/* ---------- The photos step ---------- */
.quiz-photos {
    margin-top: 1.75rem;
}

.quiz-photos__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.quiz-photos__count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-secondary-color, #6c757d);
    white-space: nowrap;
}

.quiz-photos__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

@media only screen and (min-width: 576px) {
    .quiz-photos__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.quiz-photo {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--bs-border-radius-lg);
    overflow: hidden;
    background: #EEF2F8;
}

.quiz-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quiz-photo__remove {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    width: 1.9rem;
    height: 1.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(22, 41, 73, 0.8);
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
}

.quiz-photo__remove:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.quiz-photo__remove:disabled {
    opacity: 0.5;
    cursor: default;
}

.quiz-photo--pending img {
    opacity: 0.45;
}

.quiz-photo__status {
    position: absolute;
    inset: auto 0 0 0;
    padding: 0.25rem;
    background: rgba(22, 41, 73, 0.75);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    text-align: center;
}

.quiz-photos__add {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.85rem;
    border: 1px solid var(--bs-secondary);
    color: var(--bs-secondary);
    font-weight: 600;
    cursor: pointer;
}

.quiz-photos__add:hover {
    background-color: rgba(var(--secondary-color-rgb), 0.06);
}

.quiz-photos__add:focus-within {
    outline: 2px solid var(--bs-secondary);
    outline-offset: 2px;
}

.quiz-photos__add.is-disabled {
    opacity: 0.45;
    cursor: default;
}

/* Google's suggestions box, where it stands in for the city or the location
   box (find_a_roommate.js), looking as they do. Its insides are a closed
   shadow root: only the element and its ::part()s can be styled. The same
   rules as the flat-fee card's (flat_fee.css), with this page's padding. */
.roommate-quick-form gmp-place-autocomplete,
.quiz-location gmp-place-autocomplete {
    display: block;
    color-scheme: light;
    background-color: #fafafa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    color: #000;
    font-family: "Poppins", sans-serif;
    font-size: 1rem;
    line-height: 1.5rem;
    transition: all 0.3s ease;
}

.roommate-quick-form gmp-place-autocomplete::part(input),
.quiz-location gmp-place-autocomplete::part(input) {
    padding: calc(0.7rem - 0.5px) 1.25rem;
}

.roommate-quick-form gmp-place-autocomplete::part(input)::placeholder,
.quiz-location gmp-place-autocomplete::part(input)::placeholder {
    color: rgba(0, 0, 0, 0.6);
    opacity: 0.6;
}

.roommate-quick-form gmp-place-autocomplete::part(focus-ring),
.quiz-location gmp-place-autocomplete::part(focus-ring) {
    display: none;
}

.roommate-quick-form gmp-place-autocomplete:focus-within,
.quiz-location gmp-place-autocomplete:focus-within {
    /* The fallback for the member's profile page, which doesn't load room-finder.css. */
    border-color: var(--primary-color, #e98d81);
    box-shadow: 0 0 0 0.2rem rgba(233, 141, 129, 0.25);
    background-color: white;
}

/* "Just looking?": the way into the public browse, overlapping the hero's foot
   (partials/entry_card.html; the design's HANDOFF §7.6). The hero leaves room
   for the part of the card that overlaps it. */
.roommate-hero--entry {
    padding-bottom: calc(var(--panel-space) + 64px);
}

.roommate-entry {
    position: relative;
    z-index: 2;
    margin-top: -64px;
    padding: 0 16px;
}

.roommate-entry__card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 32px;
    box-sizing: border-box;
    max-width: 960px;
    margin: 0 auto;
    padding: 22px 26px 22px 24px;
    border-radius: 28px;
    background: #FAF7F3;
    box-shadow: 0 14px 36px rgba(18, 34, 60, 0.12), 0 0 0 1px #EDE3DB;
}

.roommate-entry__arches {
    flex: none;
    display: flex;
    align-items: flex-end;
}

.roommate-entry__arches span {
    display: block;
    width: 64px;
    height: 82px;
    border-radius: 999px 999px 10px 10px;
    overflow: hidden;
    box-shadow: 0 0 0 3px #FAF7F3;
}

.roommate-entry__arches span + span {
    margin-left: -12px;
}

.roommate-entry__arches .roommate-entry__arch--tall {
    position: relative;
    width: 74px;
    height: 100px;
}

.roommate-entry__arches img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.roommate-entry__body {
    flex: 1 1 520px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.roommate-entry__title {
    margin: 0;
    font-family: "Poppins", sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: #12223C;
}

.roommate-entry__form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.roommate-entry__city {
    position: relative;
    flex: 1 1 260px;
    min-width: 0;
}

.roommate-entry__pin {
    position: absolute;
    z-index: 1;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: #12223C;
    pointer-events: none;
}

/* The plain box, and Google's in its place once the suggestions load (its
   insides are a closed shadow root: only it and its ::part()s take styles). */
.roommate-entry__city input,
.roommate-entry__city gmp-place-autocomplete {
    display: block;
    box-sizing: border-box;
    width: 100%;
    border: 1.5px solid #7D8899;
    border-radius: 999px;
    background: #fff;
    color: #12223C;
    color-scheme: light;
    font: 400 16px/1.5 "Poppins", sans-serif;
}

.roommate-entry__city input {
    height: 52px;
    padding: 0 20px 0 50px;
}

.roommate-entry__city input::placeholder {
    color: #6B7684;
    opacity: 1;
}

.roommate-entry__city gmp-place-autocomplete::part(input) {
    padding: 13px 20px 13px 50px;
}

.roommate-entry__city gmp-place-autocomplete::part(focus-ring) {
    display: none;
}

.roommate-entry__city input:focus-visible,
.roommate-entry__city gmp-place-autocomplete:focus-within {
    outline: 0;
    border-color: #162949;
    box-shadow: 0 0 0 1.5px #162949;
}

.roommate-entry__button {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    height: 52px;
    padding: 0 26px;
    border: 1.5px solid #162949;
    border-radius: 999px;
    background: #fff;
    color: #162949;
    font: 600 15px/1 "Poppins", sans-serif;
    white-space: nowrap;
    cursor: pointer;
}

.roommate-entry__button:hover {
    background: #F2F5F9;
}

.roommate-entry__button:focus-visible {
    outline: 3px solid #162949;
    outline-offset: 2px;
}

@media (max-width: 639px) {
    .roommate-entry__card {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 20px;
    }

    .roommate-entry__arches {
        align-self: flex-start;
    }

    .roommate-entry__body {
        flex: none;
    }

    .roommate-entry__city,
    .roommate-entry__button {
        flex: 1 1 100%;
    }
}
