/* Made-to-order jersey forms: the friends & family page and the public Custom
   Design Pool Jersey page share this sheet, plus the markup in
   html/components/jersey-order.html and the behaviour in js/jersey-order.js. */

.fr-hero { margin-bottom: 2.5rem; }

.fr-badge {
    display: inline-block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #d4a51a;
    border: 1px solid rgba(212, 165, 26, 0.35);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    margin-bottom: 0.9rem;
}

.fr-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.2rem, 7vw, 3.6rem);
    line-height: 0.95;
    color: #f0ece4;
    margin: 0 0 0.6rem;
    letter-spacing: 0.01em;
}

.fr-lede {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #7a7d88;
    max-width: 46ch;
    margin: 0;
}

.fr-section {
    background: #11131a;
    border: 1px solid #1b1e28;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.fr-section-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #f0ece4;
    margin-bottom: 1.25rem;
}

.fr-num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.95rem;
    color: #d4a51a;
    border: 1px solid rgba(212, 165, 26, 0.3);
    border-radius: 3px;
    padding: 0.1rem 0.4rem;
    line-height: 1.2;
}

.fr-optional {
    font-size: 0.7rem;
    font-weight: 400;
    color: #5a5d68;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Design choice cards */
.fr-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.fr-radio-card { cursor: pointer; }
.fr-radio-card input { position: absolute; opacity: 0; pointer-events: none; }

.fr-radio-body {
    display: block;
    padding: 0.9rem 1rem;
    background: #0d0f14;
    border: 1px solid #1b1e28;
    border-radius: 5px;
    transition: border-color 0.2s, background 0.2s;
}
.fr-radio-card:hover .fr-radio-body { border-color: #2a2d35; }
.fr-radio-card input:checked + .fr-radio-body {
    border-color: #d4a51a;
    background: rgba(212, 165, 26, 0.06);
}
.fr-radio-card input:focus-visible + .fr-radio-body { outline: 2px solid #d4a51a; outline-offset: 2px; }

.fr-radio-title {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    color: #f0ece4;
    margin-bottom: 0.15rem;
}

.fr-radio-sub {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    color: #5a5d68;
}

/* Fields */
.fr-label {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    color: #a0a3ad;
    margin-bottom: 0.4rem;
}

.fr-input {
    width: 100%;
    background: #0d0f14;
    border: 1px solid #1b1e28;
    border-radius: 4px;
    color: #f0ece4;
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    padding: 0.6rem 0.75rem;
    transition: border-color 0.2s;
}
.fr-input:focus { outline: none; border-color: #d4a51a; }
.fr-input::placeholder { color: #3a3d45; }

.fr-textarea { resize: vertical; line-height: 1.55; }

.fr-hint {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    color: #5a5d68;
    line-height: 1.55;
    margin: 0.55rem 0 0;
}

.fr-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.fr-field { flex: 1; min-width: 200px; }
.fr-field-narrow { flex: 0 0 120px; min-width: 120px; }

/* Roster rows */
.fr-hint-top { margin: -0.5rem 0 1rem; }

.fr-roster-head,
.fr-jersey-row {
    display: grid;
    grid-template-columns: 100px 108px 1fr 1fr 74px 32px;
    gap: 0.6rem;
    align-items: center;
}

.fr-roster-head {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5a5d68;
    padding: 0 0 0.5rem;
}

.fr-jersey-row { margin-bottom: 0.6rem; }
.fr-qty { text-align: center; }

.fr-row-remove {
    background: none;
    border: 1px solid #1b1e28;
    border-radius: 4px;
    color: #5a5d68;
    font-size: 1.1rem;
    line-height: 1;
    height: 34px;
    cursor: pointer;
    transition: all 0.2s;
}
.fr-row-remove:hover { border-color: #ef4444; color: #ef4444; }

.fr-add-row {
    background: none;
    border: 1px dashed #2a2d35;
    border-radius: 4px;
    color: #a0a3ad;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    padding: 0.6rem 1rem;
    width: 100%;
    cursor: pointer;
    margin-top: 0.4rem;
    transition: all 0.2s;
}
.fr-add-row:hover { border-color: #d4a51a; color: #d4a51a; }

/* Catalog design grid */
.fr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    max-height: 460px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.fr-design { cursor: pointer; }
.fr-design input { position: absolute; opacity: 0; pointer-events: none; }

.fr-design-body {
    display: block;
    border: 1px solid #1b1e28;
    border-radius: 5px;
    overflow: hidden;
    background: #0d0f14;
    transition: border-color 0.2s;
}
.fr-design:hover .fr-design-body { border-color: #2a2d35; }
.fr-design input:checked + .fr-design-body { border-color: #d4a51a; }
.fr-design input:focus-visible + .fr-design-body { outline: 2px solid #d4a51a; outline-offset: 2px; }

.fr-design-img { display: block; aspect-ratio: 3 / 4; background: #0d0f14; }
.fr-design-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fr-design-placeholder { display: block; width: 100%; height: 100%; }

.fr-design-name {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    line-height: 1.35;
    color: #a0a3ad;
    padding: 0.45rem 0.5rem;
}
.fr-design input:checked + .fr-design-body .fr-design-name { color: #d4a51a; }

/* Design uploader: a drop zone over the real file input, then one row per
   picked file. The input is visually hidden but stays in the form, so the
   files still post as ordinary multipart fields. */
.fr-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.6rem 1rem;
    background: #0d0f14;
    border: 1px dashed #2a2d35;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.fr-dropzone:hover,
.fr-dropzone.is-dragover {
    border-color: #d4a51a;
    background: rgba(212, 165, 26, 0.04);
}
.fr-dropzone.is-full { cursor: default; opacity: 0.55; }
.fr-dropzone.is-full:hover { border-color: #2a2d35; background: #0d0f14; }
.fr-dropzone:focus-within { outline: 2px solid #d4a51a; outline-offset: 2px; }

.fr-dropzone-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    color: #f0ece4;
}
.fr-dropzone-sub {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    color: #5a5d68;
}

.fr-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.fr-file-list {
    list-style: none;
    margin: 0.85rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.fr-file-list:empty { display: none; }

.fr-file-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.45rem 0.5rem;
    background: #0d0f14;
    border: 1px solid #1b1e28;
    border-radius: 4px;
}
.fr-file-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}
.fr-file-meta { min-width: 0; }
.fr-file-name {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    color: #f0ece4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fr-file-size {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    color: #5a5d68;
}
.fr-file-remove {
    background: none;
    border: 1px solid #1b1e28;
    border-radius: 4px;
    color: #5a5d68;
    font-size: 1.1rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.2s;
}
.fr-file-remove:hover { border-color: #ef4444; color: #ef4444; }

.fr-upload-error {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    color: #ef4444;
    margin: 0.55rem 0 0;
}

/* Submit bar */
.fr-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: #11131a;
    border: 1px solid rgba(212, 165, 26, 0.2);
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
}

.fr-price-label {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #5a5d68;
}
.fr-price-value {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    color: #d4a51a;
    line-height: 1.1;
}
.fr-price-sub {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    color: #5a5d68;
    margin-left: 0.4rem;
}

.fr-btn { min-width: 180px; }

.fr-font-link {
    display: inline-block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    color: #d4a51a;
    text-decoration: underline;
    margin-top: 0.45rem;
}
.fr-font-link:hover { color: #e8bd3a; }

/* Font preview modal */
.fr-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.fr-modal[hidden] { display: none; }

.fr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.fr-modal-box {
    position: relative;
    background: #11131a;
    border: 1px solid #1b1e28;
    border-radius: 6px;
    padding: 1.5rem;
    max-width: 720px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
}

.fr-modal-close {
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    background: none;
    border: none;
    color: #5a5d68;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.fr-modal-close:hover { color: #f0ece4; }

.fr-modal-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    color: #f0ece4;
    margin: 0 0 1rem;
}

.fr-modal-img { width: 100%; height: auto; display: block; border-radius: 4px; }

.fr-cart-nudge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding: 1rem 1.5rem;
    background: #0d0f14;
    border: 1px solid #1b1e28;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: #a0a3ad;
}

@media (max-width: 640px) {
    .fr-choice { grid-template-columns: 1fr; }
    .fr-submit { flex-direction: column; align-items: stretch; }
    .fr-btn { width: 100%; }

    /* Roster rows stack into labelled cards rather than a squeezed 5-up grid. */
    .fr-roster-head { display: none; }
    .fr-jersey-row {
        grid-template-columns: 1fr 1fr 74px 32px;
        grid-template-areas:
            "size length qty remove"
            "front front front front"
            "back back back back";
        padding: 0.85rem;
        margin-bottom: 0.85rem;
        background: #0d0f14;
        border: 1px solid #1b1e28;
        border-radius: 5px;
    }
    .fr-jersey-row select[name="size"] { grid-area: size; }
    .fr-jersey-row select[name="length"] { grid-area: length; }
    .fr-jersey-row input[name="name_front"] { grid-area: front; }
    .fr-jersey-row input[name="name_back"] { grid-area: back; }
    .fr-jersey-row input[name="quantity"] { grid-area: qty; }
    .fr-jersey-row .fr-row-remove { grid-area: remove; }
}
