/*
 * Post-a-job wizard styles, shared by the guest pages and the homeowner
 * dashboard pages. Layout is done with Tailwind utilities in the blades;
 * this file owns the wizard's own components (indicator, card, fields,
 * buttons, photo slots, OTP row, review) and the state classes toggled by
 * post-job-wizard.js.
 */

.step { display: none; }
.step.active { display: block; }

/* Leave room for the fixed template header when scrolling to the form. */
#postJobForm { scroll-margin-top: 130px; }

/* ---- step indicator ---- */

.wizard-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    /* Without a cap the connectors stretch across a desktop column and the
       three dots drift to the far edges. */
    max-width: 560px;
    margin: 0 auto 26px;
}

.wizard-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 110px;
    flex-shrink: 0;
}

.wizard-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #dfe3e8;
    background: #fff;
    color: #a4a4a4;
    font-weight: 700;
    font-size: 16px;
    transition: all .25s;
}

.wizard-step-label {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.25;
    color: #8b9199;
}

.wizard-connector {
    flex: 1;
    height: 2px;
    background: #dfe3e8;
    margin-top: 21px;
    min-width: 24px;
    transition: background .25s;
}

.wizard-step-item.is-active .wizard-dot {
    border-color: #049406;
    background: #049406;
    color: #fff;
}

.wizard-step-item.is-active .wizard-step-label,
.wizard-step-item.is-complete .wizard-step-label {
    color: #049406;
    font-weight: 700;
}

/* Completed steps swap their number for a tick, on the same green disc. */
.wizard-step-item.is-complete .wizard-dot {
    border-color: #049406;
    background: #049406;
    color: #fff;
}

.wizard-step-item.is-complete .wizard-dot .wizard-dot-number { display: none; }
.wizard-step-item .wizard-dot .wizard-dot-check { display: none; }
.wizard-step-item.is-complete .wizard-dot .wizard-dot-check { display: block; }

.wizard-connector.is-complete { background: #049406; }

/* ---- card ---- */

.wizard-card {
    background: #fff;
    border: 1px solid #e8ebee;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(52, 52, 52, .04);
}

.wizard-card + .wizard-card,
.wizard-card + .wizard-tip,
.wizard-tip + .wizard-card { margin-top: 16px; }

@media (min-width: 768px) {
    .wizard-card { padding: 26px; }
}

.wizard-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.wizard-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #effae8;
    color: #049406;
    flex-shrink: 0;
}

.wizard-card-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.3;
    color: #343434;
}

.wizard-card-subtitle {
    margin: 2px 0 0;
    font-size: 14px;
    line-height: 1.45;
    color: #8b9199;
}

/* ---- fields ---- */

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

.field-label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    font-size: 15px;
    color: #343434;
}

.field-label .req { color: #dd4d42; }

.field-control { position: relative; }

/* z-index: the field's own white background would otherwise paint over the
   icon once the address input is wrapped for its suggestions dropdown. */
.field-icon {
    position: absolute;
    z-index: 2;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: #a4a4a4;
    pointer-events: none;
}

/* Textareas grow, so their icon sits on the first line instead. */
.field-control.is-textarea .field-icon {
    top: 18px;
    transform: none;
}

.field-hint {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: #8b9199;
}

/* Body copy inside a wizard card. The template's `body { line-height: 1 }`
   leaves bare paragraphs cramped, so card text states its own. */
.wizard-text {
    font-size: 15px;
    line-height: 1.6;
    color: #343434;
}

.wizard-text.is-muted { color: #8b9199; }

.field-count {
    display: block;
    margin-top: 6px;
    text-align: right;
    font-size: 13px;
    color: #a4a4a4;
}

/* The template's .simple-input is a 26px pill; the wizard uses the softer
   rounded field from the designs. */
.wizard-card .simple-input {
    height: 52px;
    line-height: 50px;
    padding: 0 16px;
    border: 1px solid #e2e6ea;
    border-radius: 12px;
    font-size: 15px;
    color: #343434;
    background: #fff;
}

.wizard-card textarea.simple-input {
    height: 140px;
    line-height: 22px;
    padding-top: 14px;
    padding-bottom: 14px;
}

/* The template hides the native select arrow, so the wizard draws its own. */
.wizard-card select.simple-input {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 44px;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23575757' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px 20px;
}

.field-control.has-icon .simple-input { padding-left: 46px; }

.wizard-card .simple-input::placeholder { color: #a4a4a4; }

.wizard-card .simple-input:focus {
    border-color: #049406;
    box-shadow: 0 0 0 3px rgba(4, 148, 6, .12);
}

/* ---- buttons ---- */

.wizard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    padding: 0 26px;
    border: 1.5px solid #049406;
    border-radius: 28px;
    background: #049406;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s;
}

.wizard-btn:hover {
    background: #037a05;
    border-color: #037a05;
    color: #fff;
}

.wizard-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.wizard-btn-outline {
    background: #fff;
    color: #049406;
}

.wizard-btn-outline:hover {
    background: #effae8;
    border-color: #049406;
    color: #049406;
}

.wizard-btn-block {
    display: flex;
    width: 100%;
}

.wizard-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
}

.wizard-actions .wizard-btn { flex: 1 1 0; }
.wizard-actions .wizard-btn-outline { flex: 0 1 40%; }

/* ---- tip box ---- */

.wizard-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #effae8;
    font-size: 14px;
    line-height: 1.45;
    color: #343434;
}

.wizard-tip svg {
    color: #049406;
    flex-shrink: 0;
    margin-top: 2px;
}

.wizard-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #eff4ff;
    font-size: 14px;
    line-height: 1.45;
    color: #343434;
}

.wizard-note svg {
    color: #1b64f2;
    flex-shrink: 0;
    margin-top: 2px;
}

.wizard-note strong { color: #1b64f2; }

/* ---- photo slots ---- */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 768px) {
    .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.photo-slot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 118px;
    margin: 0;
    padding: 14px 10px;
    border: 1.5px dashed #d5dbe1;
    border-radius: 12px;
    background: #fff;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background-color .2s;
}

.photo-slot:hover {
    border-color: #049406;
    background: #fbfefa;
}

.photo-slot input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.photo-slot-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #049406;
}

.photo-slot-title {
    font-weight: 700;
    font-size: 14px;
    color: #343434;
}

.photo-slot-cta {
    font-size: 13px;
    color: #049406;
}

/* A filled slot swaps the prompt for the image itself. */
.photo-slot.is-filled {
    border-style: solid;
    border-color: #e2e6ea;
    padding: 0;
    cursor: default;
}

.photo-slot.is-filled .photo-slot-empty { display: none; }
.photo-slot-preview { display: none; }
.photo-slot.is-filled .photo-slot-preview { display: block; width: 100%; }

.photo-slot-preview img {
    display: block;
    width: 100%;
    height: 118px;
    object-fit: cover;
    border-radius: 11px;
}

.photo-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    line-height: 22px;
    border-radius: 50%;
    background: #dd4d42;
    color: #fff;
    border: none;
    font-size: 14px;
    cursor: pointer;
}

/* The template's masonry .grid (style.css) sets negative margins that break
   Tailwind's .grid layouts. This stylesheet only loads on wizard pages,
   which never use the masonry grid. */
.grid {
    position: static;
    margin: 0;
}

/* ---- address suggestions dropdown (Autocomplete Data API) ---- */

.address-suggest {
    position: relative;
}

.address-suggest-list {
    position: absolute;
    top: calc(100% - 6px);
    left: 0;
    right: 0;
    z-index: 60;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(52, 52, 52, .12);
    overflow: hidden;
}

/* The dropdown also renders inside .simple-article on the dashboard pages,
   whose typography styles reach into any ul/li it contains
   (`.simple-article ul` adds a 22px bottom margin, `.simple-article ul li` a
   4px vertical padding). Two-class selectors out-rank those without needing
   !important, so the dropdown looks the same on every page. */
.address-suggest .address-suggest-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.address-suggest-list .address-suggest-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    padding: 11px 22px;
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
}

.address-suggest-item:hover,
.address-suggest-item.is-active {
    background: #effae8;
}

.address-suggest-main {
    display: block;
    color: #343434;
    font-weight: 700;
}

.address-suggest-secondary {
    display: block;
    color: #a4a4a4;
    font-size: 13px;
}

/* Announces result counts to screen readers only — the sighted user can
   see the list itself. */
.address-suggest-status {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- form errors (matches the auth pages' invalid styling) ---- */

.error { border: 1px solid #dd4d42 !important; }

.error-text {
    color: #dd4d42;
    font-size: 12px;
    display: block;
    margin-top: 6px;
}

/* ---- OTP ---- */

.otp-row {
    display: flex;
    align-items: stretch;
    border: 1px solid #e2e6ea;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.otp-row:focus-within { border-color: #049406; }

/* Beats the template's .simple-input border/radius without !important.
   No letter-spacing tricks: the typed code reads in the same face and
   rhythm as every other field on the page. */
.wizard-card .otp-row .simple-input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.otp-send {
    flex-shrink: 0;
    padding: 0 22px;
    border: none;
    border-left: 1px solid #e2e6ea;
    background: #fff;
    color: #049406;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background-color .2s;
}

.otp-send:hover:not(:disabled) { background: #effae8; }
.otp-send:disabled { color: #a4a4a4; cursor: not-allowed; }

.otp-meta {
    margin-top: 10px;
    font-size: 14px;
    color: #8b9199;
}

.otp-meta [data-otp-countdown] {
    color: #049406;
    font-weight: 700;
}

/* The stand-alone OTP button pair, used where the buttons sit next to the
   field instead of inside the wizard's joined row: the profile pages and
   the tradesman verification step both load this file for them. */
#sendOtpBtn:not(.otp-send),
#verifyOtpBtn:not(.otp-send) {
    height: 50px;
    line-height: 48px;
    padding: 0 28px;
    border-radius: 26px;
    border: 1px solid #049406;
    background: #fff;
    color: #049406;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}

#sendOtpBtn:not(.otp-send):hover:not(:disabled) { background: #effae8; }

#verifyOtpBtn:not(.otp-send) {
    background: #049406;
    color: #fff;
}

#verifyOtpBtn:not(.otp-send):hover:not(:disabled) {
    background: #035a36;
    border-color: #035a36;
}

#sendOtpBtn:not(.otp-send):disabled,
#verifyOtpBtn:not(.otp-send):disabled {
    border-color: #c8c8c8;
    background: #fff;
    color: #a4a4a4;
    cursor: default;
}

[data-otp-status] { display: block; font-size: 13px; margin-top: 6px; min-height: 18px; }
[data-otp-status].is-error { color: #dd4d42; }
[data-otp-status].is-success { color: #049406; }

.otp-verified {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #effae8;
    color: #049406;
    font-weight: 700;
}

/* ---- review step ---- */

.review-head { text-align: center; margin-bottom: 22px; }

.review-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #049406;
    margin-bottom: 14px;
}

/* The circled icon sits on a rule that spans the column. */
.review-rule {
    display: flex;
    align-items: center;
    gap: 0;
}

.review-rule::before,
.review-rule::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #049406;
}

.review-rule-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid #049406;
    background: #fff;
    color: #049406;
    flex-shrink: 0;
}

.review-lead {
    margin: 14px 0 0;
    font-size: 15px;
    color: #8b9199;
}

.review-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #049406;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.review-table {
    border: 1px solid #e8ebee;
    border-radius: 12px;
    overflow: hidden;
}

.review-row {
    display: grid;
    grid-template-columns: minmax(110px, 40%) 1fr;
    gap: 12px;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.45;
}

.review-row + .review-row { border-top: 1px solid #f0f2f4; }

.review-row dt { font-weight: 700; color: #343434; }
.review-row dd { margin: 0; color: #575757; }

@media (max-width: 480px) {
    .wizard-step-item { width: 84px; }
    .wizard-step-label { font-size: 11px; }
    .wizard-dot { width: 36px; height: 36px; font-size: 14px; }
    .wizard-connector { margin-top: 17px; }

    /* The job wizard's labels don't fit at a fixed width on a phone
       (a 375px screen clipped "Category & Location"). Sharing the row keeps
       every label visible at any width; the registration stepper has its own
       narrower rules in tradesman-verification.css and is unaffected. */
    .wizard-steps--fluid .wizard-step-item {
        width: auto;
        flex: 1 1 0;
        min-width: 0;
    }

    /* break-word, not anywhere: `anywhere` also shrinks the flex item's
       min-content width, which split "Description" mid-word. */
    .wizard-steps--fluid .wizard-step-label {
        font-size: 10px;
        overflow-wrap: break-word;
    }

    .wizard-steps--fluid .wizard-dot {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .wizard-steps--fluid .wizard-dot .wizard-dot-check {
        width: 14px;
        height: 14px;
    }

    .wizard-steps--fluid .wizard-connector {
        margin-top: 15px;
        min-width: 4px;
    }

    .wizard-btn { padding: 0 18px; font-size: 14px; }
    .wizard-actions .wizard-btn-outline { flex: 0 1 42%; }
}
