/**
 * Personal Shopping request card (/pre-orders/).
 *
 * A bordered card split title-aside / fields, matching the approved flow in
 * Figma. It sits between the page's informational sections and the contact
 * band, so it follows the same palette (#1a1a1a text, Inter body, Canela
 * headings) and the same 150/40/24px page gutters rather than introducing a
 * look of its own.
 */

.ps-section {
    padding: 96px 150px 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1a1a1a;
}

/* display:flex on the error elements below would otherwise beat [hidden]'s
   display:none and show every error state on a freshly loaded form. */
.ps-section [hidden] { display: none; }

.ps-card {
    display: grid;
    grid-template-columns: 1fr 2fr;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.ps-card-aside { padding: 40px; }
.ps-card-main { padding: 40px 48px 48px; }

.ps-title {
    margin: 0 0 24px;
    font-family: 'Canela Text', Georgia, serif;
    font-size: 48px;
    font-weight: 400;
    line-height: 1.1;
    color: #1a1a1a;
}

.ps-intro {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #4a4a4a;
}

/* ── fields ──────────────────────────────────────────────────────── */

.ps-form { display: flex; flex-direction: column; gap: 28px; }
.ps-field { display: flex; flex-direction: column; gap: 10px; }

.ps-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #1a1a1a;
}

/* Name and phone carry their label in the placeholder, per the design. The
   real label stays in the markup for screen readers and autofill. */
.ps-label--hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.ps-form textarea,
.ps-form input[type="text"],
.ps-form input[type="tel"] {
    width: 100%;
    padding: 16px;
    font-family: inherit;
    font-size: 14px;
    color: #1a1a1a;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}
.ps-form textarea { resize: vertical; min-height: 212px; }
.ps-form ::placeholder { color: #9a9a9a; opacity: 1; }
.ps-form textarea:focus,
.ps-form input:focus { outline: none; border-color: #1a1a1a; }

/* The fields lock once the request is in, so they read as a record of what was
   sent rather than something still being edited. The button has its own sent
   styling and is deliberately left out. */
.ps-form input:disabled,
.ps-form select:disabled,
.ps-form textarea:disabled {
    color: #8a8a8a;
    background: #fafafa;
    cursor: default;
}

.ps-row { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 900px) {
    .ps-row { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* ── phone: dial code and number share one bordered group ────────── */

.ps-phone {
    display: flex;
    align-items: stretch;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s ease;
}
.ps-phone:focus-within { border-color: #1a1a1a; }

.ps-phone-code {
    flex: 0 0 auto;
    max-width: 150px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 12px;
    color: #1a1a1a;
    background: #fafafa;
    border: 0;
    border-right: 1px solid #e5e5e5;
    cursor: pointer;
}
.ps-phone-code:focus { outline: none; }

/* The number field is already inside the group's border. */
.ps-form .ps-phone input[type="tel"] {
    border: 0;
    border-radius: 0;
    flex: 1 1 auto;
    min-width: 0;
}

/* ── the photo ───────────────────────────────────────────────────── */

.ps-photo {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.ps-photo-tile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #f7f7f7;
    overflow: hidden;
}
.ps-photo-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ps-photo-placeholder { width: 28px; height: 28px; color: #b5b5b5; }
/* Once a photo is in, the placeholder behind it is noise. */
.ps-photo-preview:not([hidden]) + .ps-photo-placeholder { display: none; }

/* A text link, not a button: choosing the photo is the exception here, since
   it usually arrives from the search the customer just ran. */
.ps-photo-pick {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #1a1a1a;
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
}
.ps-photo-pick:hover { color: #000; }

/* ── actions ─────────────────────────────────────────────────────── */

.ps-submit {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 53px;
    padding: 0 28px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    background: #000;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.ps-submit:hover:not(:disabled) { background: #1f1f1f; }
.ps-submit:disabled { cursor: default; }

.ps-submit-icon { width: 18px; height: 18px; flex-shrink: 0; }
.ps-submit-icon--check { display: none; }

/* Sent: the button stops being an action and becomes a receipt. */
.ps-submit.is-sent {
    background: #e5e5e5;
    color: #8a8a8a;
}
.ps-submit.is-sent .ps-submit-icon--send { display: none; }
.ps-submit.is-sent .ps-submit-icon--check { display: block; }

/* ── errors ──────────────────────────────────────────────────────── */

/* Form-level: the server's reason (rate limiting) or a count of the fields
   that still need attention. */
.ps-error {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.5;
    color: #ad2c2c;
    background: #fbf3f3;
    border-radius: 8px;
}
.ps-error svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Field-level: sits under the control it is about. */
.ps-field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #ad2c2c;
}
.ps-field-error svg { width: 14px; height: 14px; flex-shrink: 0; }

.ps-phone.is-invalid,
.ps-form input.is-invalid,
.ps-form textarea.is-invalid {
    border-color: #ad2c2c;
    background: #fdf7f7;
}
.ps-phone.is-invalid .ps-phone-code { background: #fdf7f7; border-right-color: #eccfcf; }

/* ── success ─────────────────────────────────────────────────────── */

.ps-success {
    margin-top: 32px;
    padding: 48px 32px;
    text-align: center;
    background: #191919;
    border-radius: 12px;
}

.ps-success-title {
    margin: 0 0 8px;
    font-family: 'Canela Text', Georgia, serif;
    font-size: 32px;
    font-weight: 400;
    color: #fff;
}

/* The reference is the join key between the WhatsApp chat and the stored
   request, so it is the most important thing on this screen. */
.ps-reference {
    margin: 0 0 16px;
    font-family: 'Canela Text', Georgia, serif;
    font-size: 36px;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: #fff;
}

.ps-success-body {
    margin: 0 0 28px;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
}

.ps-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 53px;
    padding: 0 28px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    color: #fff;
    background: #25d366;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}
.ps-whatsapp:hover { background: #1db954; }
.ps-whatsapp svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── responsive ──────────────────────────────────────────────────── */

@media (max-width: 1023px) and (min-width: 768px) {
    .ps-section { padding: 64px 40px 0; }
}

@media (max-width: 1023px) {
    .ps-card { grid-template-columns: 1fr; }
    .ps-card-aside { padding: 32px 24px 0; }
    .ps-card-main { padding: 24px; }
    .ps-title { font-size: 36px; margin-bottom: 16px; }
    .ps-form textarea { min-height: 160px; }
}

@media (max-width: 767px) {
    .ps-section { padding: 48px 24px 0; }
    .ps-success { padding: 36px 20px; }
    .ps-success-title { font-size: 26px; }
    .ps-reference { font-size: 30px; }
}
