/* =====================================================
   SIGNUP — extends login.css's shared wrapper/card/panel
   with the same light theme tokens. Only wizard-specific
   pieces (progress steps, role cards, multi-column form,
   uploads, strength meter) are defined here.
===================================================== */

.signup-card {
    height: min(820px, calc(100vh - 64px));
}

.signup-left {
    justify-content: flex-start;
    padding-top: 40px;
}

/* =====================================================
   PROGRESS STEPS
===================================================== */

.progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0 26px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #98a2b3;
    font-size: 12px;
    font-weight: 600;
}

.progress-step .circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid #d0d5dd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #98a2b3;
    transition: .2s;
}

.progress-step.active .circle {
    border-color: #d0001b;
    color: #fff;
    background: #d0001b;
}

.progress-step.active {
    color: #101828;
}

.progress-line {
    width: 40px;
    height: 1px;
    background: #eaecf0;
}

/* =====================================================
   STEP 1 — ROLE CARDS
===================================================== */

.role-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 8px;
}

/* Third card (Rider) sits on its own row, so let it fill the row instead
   of leaving an empty slot beside it. */
.role-card[data-role="courier"] {
    grid-column: 1 / -1;
}

.role-card {
    background: linear-gradient(180deg, #fff 0%, #fcfcfd 100%);
    border: 1px solid #eaecf0;
    border-radius: 14px;
    padding: 26px 18px;
    text-align: center;
    cursor: pointer;
    transition: .2s;
    position: relative;
    box-shadow:
        0 1px 1px rgba(16,24,40,.03),
        0 8px 16px -4px rgba(16,24,40,.10),
        0 20px 34px -12px rgba(16,24,40,.14);
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.role-card:hover,
.role-card.selected {
    border-color: #f4a4a4;
    box-shadow:
        0 1px 1px rgba(208,0,27,.05),
        0 10px 20px -4px rgba(208,0,27,.20),
        0 26px 44px -14px rgba(208,0,27,.30);
    transform: translateY(-5px);
}

.role-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(160deg, #fef3f2, #fde3e1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #d0001b;
    box-shadow: inset 0 0 0 1px rgba(208,0,27,.12);
}

.role-card h3 {
    color: #101828;
    font-size: 15.5px;
    font-weight: 800;
    margin-bottom: 8px;
}

.role-card p {
    color: #667085;
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 18px;
}

.role-select-btn {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 20px;
    border: 1.5px solid #d0001b;
    background: #fef3f2;
    color: #d0001b;
    font-size: 12px;
    font-weight: 700;
    transition: .2s;
    margin-top: auto;
}

.role-card:hover .role-select-btn,
.role-card.selected .role-select-btn {
    background: #d0001b;
    color: #fff;
    border-color: #d0001b;
    box-shadow: 0 6px 16px -4px rgba(208,0,27,.4);
}

/* =====================================================
   STEP 2 — FORM
===================================================== */

.form-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.role-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fef3f2;
    color: #d0001b;
    padding: 6px 13px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.change-role {
    font-size: 12px;
    color: #667085;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
}

.change-role:hover {
    color: #d0001b;
}

.fieldset-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #d0001b;
    margin: 22px 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fieldset-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #eaecf0;
}

.form-grid {
    display: grid;
    /* minmax(0, ...) rather than a bare 1fr: a long, un-wrappable upload
       filename would otherwise widen its own column and crush the other. */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px 18px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.form-group {
    margin-bottom: 2px;
    min-width: 0;
}

/* Side-by-side upload boxes stay the same height, so an empty one doesn't
   look shrunken next to one that's showing a preview. */
.form-group:has(> .upload-box) {
    display: flex;
    flex-direction: column;
}

.form-group > .upload-box {
    flex: 1;
}

.form-group label .optional {
    color: #98a2b3;
    text-transform: none;
    font-weight: 400;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    height: 46px;
    background: #fff;
    border: 1.5px solid #d0d5dd;
    border-radius: 10px;
    padding: 0 16px;
    outline: none;
    color: #101828;
    font-size: 13.5px;
    transition: border-color .15s, box-shadow .15s;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M0 0l6 8 6-8z' fill='%2398a2b3'/></svg>");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 36px;
}

.form-group select option {
    color: #101828;
}

.form-group input::placeholder {
    color: #98a2b3;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #d0001b;
    box-shadow: 0 0 0 4px rgba(208,0,27,0.10);
}

.form-group input:disabled,
.form-group select:disabled {
    opacity: .55;
    cursor: not-allowed;
    background: #f9fafb;
}

.form-group input[readonly] {
    color: #d0001b;
    font-weight: 700;
    background: #fef3f2;
}

/* Password fields */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 44px !important;
}

.toggle-eye {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #98a2b3;
    cursor: pointer;
    font-size: 15px;
    transition: .15s;
}

.toggle-eye:hover {
    color: #667085;
}

.strength-meter {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    height: 5px;
}

.strength-meter .segment {
    flex: 1;
    background: #eaecf0;
    border-radius: 3px;
    transition: background .2s;
}

.strength-text {
    font-size: 11.5px;
    margin-top: 7px;
    color: #98a2b3;
    min-height: 14px;
    font-weight: 500;
}

/* File upload */
.upload-box {
    position: relative;
    border: 1.5px dashed #d0d5dd;
    border-radius: 10px;
    background: #f9fafb;
    padding: 16px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: .15s;
}

.upload-box:hover {
    border-color: #d0001b;
    background: #fef3f2;
}

.upload-box i {
    font-size: 19px;
    color: #d0001b;
}

.upload-box .upload-text {
    font-size: 12.5px;
    color: #667085;
}

.upload-box .upload-text strong {
    display: block;
    color: #101828;
    font-size: 13px;
    margin-bottom: 2px;
}

.upload-box input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ---- Chosen file: the prompt is replaced by a preview card
   (built by markUploaded() in signup.js) ---- */
.upload-box.has-file {
    display: block;
    padding: 0;
    border-style: solid;
    border-color: #d0d5dd;
    background: #fff;
    overflow: hidden;
}

.upload-box.has-file:hover {
    border-color: #d0001b;
    background: #fff;
}

.upload-box.has-file > i,
.upload-box.has-file > .upload-text {
    display: none;
}

.upload-preview-media {
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(45deg, #f2f4f7 25%, transparent 25%, transparent 75%, #f2f4f7 75%),
        linear-gradient(45deg, #f2f4f7 25%, transparent 25%, transparent 75%, #f2f4f7 75%),
        #f9fafb;
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
    border-bottom: 1px solid #eaecf0;
}

/* Whole ID stays visible — never cropped, never stretched. */
.upload-preview-media img {
    max-width: calc(100% - 24px);
    max-height: calc(100% - 24px);
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 6px 16px -4px rgba(16, 24, 40, .18);
}

.upload-preview-media.is-document {
    height: 120px;
    background: #fef3f2;
}

.upload-preview-doc {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #b42318;
    font-size: 12px;
    font-weight: 600;
}

.upload-box .upload-preview-doc i {
    font-size: 34px;
    color: #d0001b;
}

.upload-preview-info {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 52px 12px 14px;
}

.upload-preview-check {
    flex: 0 0 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ecfdf3;
}

.upload-box .upload-preview-check i {
    font-size: 12px;
    color: #12b76a;
}

.upload-preview-text {
    flex: 1;
    min-width: 0;
}

.upload-preview-name {
    display: block;
    color: #101828;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-preview-meta {
    display: block;
    color: #667085;
    font-size: 11.5px;
    margin-top: 2px;
}

/* Sits above the file input that covers the box, so it can be clicked. */
.upload-preview-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #eaecf0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.upload-box .upload-preview-remove i {
    font-size: 13px;
    color: #475467;
}

.upload-preview-remove:hover {
    background: #fef3f2;
    border-color: #fda29b;
}

.upload-box .upload-preview-remove:hover i {
    color: #d0001b;
}

/* Role-specific sections */
.role-fields {
    display: none;
}

.role-fields.active {
    display: block;
}

.terms-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 22px 0 20px;
    font-size: 12px;
    color: #667085;
    line-height: 1.5;
}

.terms-row input {
    margin-top: 3px;
    width: 15px;
    height: 15px;
    accent-color: #d0001b;
}

.terms-row a {
    color: #d0001b;
    font-weight: 600;
}

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

@media (max-width: 900px) {
    .signup-card {
        height: auto;
    }

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

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

@media (max-width: 500px) {
    .progress-line {
        width: 24px;
    }
}

/* =====================================================
   SIGNUP OTP (signup-otp.blade.php) — buyer email check
===================================================== */

.otp-email {
    color: #d0001b;
    word-break: break-all;
}

.otp-boxes {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.otp-boxes input {
    flex: 0 0 58px;
    width: 58px;
    height: 64px;
    padding: 0;
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    color: #101828;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.otp-boxes input:focus {
    border-color: #d0001b;
    box-shadow: 0 0 0 4px rgba(208, 0, 27, .12);
}

.otp-expiry {
    margin: 14px 0 18px;
    text-align: center;
    font-size: 12.5px;
    color: #667085;
}

.otp-expiry.expired {
    color: #b42318;
    font-weight: 600;
}

.otp-resend {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 700;
    color: #d0001b;
    cursor: pointer;
}

.otp-resend:disabled {
    color: #98a2b3;
    cursor: default;
}

@media (max-width: 500px) {
    .otp-boxes {
        gap: 8px;
    }

    .otp-boxes input {
        flex-basis: 46px;
        width: 46px;
        height: 54px;
        font-size: 22px;
    }
}

/* =====================================================
   CONTACT NUMBER — fixed +63 prefix beside the field
===================================================== */

.phone-input {
    display: flex;
}

.phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 46px;
    background: #f2f4f7;
    border: 1.5px solid #d0d5dd;
    border-right: none;
    border-radius: 10px 0 0 10px;
    color: #344054;
    font-size: 13.5px;
    font-weight: 600;
}

.form-group .phone-input input[type="tel"] {
    flex: 1;
    min-width: 0;
    border-radius: 0 10px 10px 0;
}

/* Empty error slots (see setFieldError() in signup.js) take no space. */
.field-error:empty {
    display: none;
}

/* =====================================================
   SORTING CENTER ENROLLMENT (sorting-center-enroll.blade.php)
   — the few things that form has and signup doesn't
===================================================== */

.sc-section-note {
    margin: -6px 0 14px;
    color: #667085;
    font-size: 12px;
    line-height: 1.5;
}

.form-grid + .sc-section-note {
    margin: 8px 0 0;
    color: #98a2b3;
    font-size: 11.5px;
}

.form-group input[type="time"] {
    width: 100%;
    height: 46px;
    background: #fff;
    border: 1.5px solid #d0d5dd;
    border-radius: 10px;
    padding: 0 16px;
    outline: none;
    color: #101828;
    font-size: 13.5px;
    transition: border-color .15s, box-shadow .15s;
}

/* Operating hours: two time inputs side by side in one grid column. A time
   input won't shrink below its own built-in width unless told it may, and
   without that the pair pushes out over the next column. */
.sc-hours {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sc-hours span {
    color: #98a2b3;
}

.form-group .sc-hours input[type="time"] {
    flex: 1;
    min-width: 0;
    padding: 0 10px;
}

.form-grid > .form-group {
    min-width: 0;
}

.form-group input[type="time"]:focus {
    border-color: #d0001b;
    box-shadow: 0 0 0 4px rgba(208, 0, 27, .10);
}

/* Policy dialog (partials/policy-modal.blade.php) — Terms, Privacy and the
   role agreements, opened from the link beside a signup form's agreement
   checkbox. */
.policy-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(16, 8, 10, .62);
    backdrop-filter: blur(3px);
}

.policy-modal-overlay[hidden] {
    display: none;
}

.policy-modal-modal {
    width: min(720px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 70px -12px rgba(0, 0, 0, .55);
    animation: cardIn .25s cubic-bezier(.2, .7, .3, 1);
}

.policy-modal-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 26px;
    border-bottom: 1px solid #eaecf0;
}

.policy-modal-head::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d9a441, #d0001b, #d9a441);
}

.policy-modal-head-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #fdeaea;
    color: #d0001b;
    font-size: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.policy-modal-head-text {
    flex: 1;
    min-width: 0;
}

.policy-modal-head-text h2 {
    margin: 0 0 3px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
    color: #101828;
}

.policy-modal-head-text p {
    margin: 0;
    font-size: 12.5px;
    color: #667085;
}

.policy-modal-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #f2f4f7;
    color: #475467;
    font-size: 15px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.policy-modal-close:hover {
    background: #fdeaea;
    color: #d0001b;
}

.policy-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 26px;
    outline: none;
}

.policy-modal-signoff {
    margin-top: 26px;
    padding: 16px 18px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #eaecf0;
    text-align: center;
}

.policy-modal-signoff strong {
    display: block;
    font-size: 13.5px;
    color: #101828;
}

.policy-modal-signoff span {
    font-size: 12.5px;
    font-style: italic;
    color: #667085;
}

.policy-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 26px;
    border-top: 1px solid #eaecf0;
    background: #fcfcfd;
}

.policy-modal-btn {
    height: 42px;
    padding: 0 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .15s, border-color .15s, transform .1s;
}

.policy-modal-btn:active {
    transform: translateY(1px);
}

.policy-modal-btn-ghost {
    background: #fff;
    border: 1.5px solid #d0d5dd;
    color: #344054;
}

.policy-modal-btn-ghost:hover {
    background: #f9fafb;
}

.policy-modal-btn-primary {
    background: #d0001b;
    border: 1.5px solid #d0001b;
    color: #fff;
}

.policy-modal-btn-primary:hover {
    background: #b00017;
    border-color: #b00017;
}

@media (max-width: 500px) {
    .policy-modal-overlay {
        padding: 12px;
    }

    .policy-modal-head,
    .policy-modal-body,
    .policy-modal-foot {
        padding-left: 18px;
        padding-right: 18px;
    }

    .policy-modal-btn {
        flex: 1;
        justify-content: center;
    }
}
