/* inc/assets/css/service-form.css */

:root {
    --brand:      #004aad;
    --brand-dark: #003480;
    --brand-lite: #e8f0ff;
    --accent:     #f5a623;
    --surface:    #ffffff;
    --bg:         #f0f4fb;
    --border:     #dde4f0;
    --text:       #1a2340;
    --muted:      #6b7694;
    --error:      #ef4444;
    --success:    #22c55e;
    --radius-sm:  8px;
    --radius-md:  14px;
    --radius-lg:  20px;
    --shadow-sm:  0 2px 8px rgba(0,74,173,.07);
    --shadow-md:  0 8px 32px rgba(0,74,173,.12);
    --shadow-lg:  0 0px 10px rgba(0,74,173,.15);
    --transition: .25s cubic-bezier(.4,0,.2,1);
}
.phone-input-field{
box-shadow:none;
border-color:var(--border);
}
.pm-fields-grid input:focus{
box-shadow:none;
border-color:var(--brand);
}
.pm-fields-grid,
input#inp-phone {
    border: none !important;
    box-shadow: none !important;
    overflow:hidden;
}
/* ─── WRAPPER ─────────────────────────────────── */
#pm-service-form {
    max-width: 660px;
    width: 100%;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: visible;  /* allow dropdown to overflow */
    position: relative;
    margin: 40px auto;
}



.form-inner {
    padding: 44px 48px 48px;
    overflow: visible;
}

/* ─── STEPPER ─────────────────────────────────── */
.pm-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 40px;
    padding: 0 4px;
}

.pm-step {
    position: relative;
    flex-shrink: 0;
    z-index: 1;
}

.step-bubble {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    transition: all var(--transition);
}

.pm-step.active .step-bubble {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 0px 10px rgba(0,74,173,.35);
    transform: scale(1.08);
}

.pm-step.done .step-bubble {
    background: var(--brand);
    color: #fff;
}

/* Connector track between bubbles */
.pm-step-track {
    flex: 1;
    height: 3px;
    background: var(--border);
    position: relative;
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
    max-width: 140px;
}

.pm-step-fill {
    position: absolute;
    left: 0; top: 0;
    height: 100%;
    width: 0%;
    background: var(--brand);
    border-radius: 3px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* ─── FORM HEADER ─────────────────────────────── */
.pm-form-header {
    margin-bottom: 28px;
}
.pm-form-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.2;
}
.pm-form-header h2 span {
    color: var(--brand);
}
.pm-form-header p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* ─── STEP PANELS ─────────────────────────────── */
.pm-step-panel {
    display: none;
    animation: pmFadeUp .35s ease;
}
.pm-step-panel.active {
    display: block;
}

@keyframes pmFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── CATEGORY RADIO CARDS ────────────────────── */
.pm-categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pm-radio-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--surface);
    user-select: none;
    position: relative;
}
.pm-radio-card:hover {
    border-color: var(--brand);
    background: var(--brand-lite);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.pm-radio-card.selected {
    border-color: var(--brand);
    background: var(--brand-lite);
    box-shadow: var(--shadow-sm);
}
.pm-radio-card input[type="radio"] {
    display: none;
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--brand-lite);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--brand);
    transition: all var(--transition);
}
.pm-radio-card:hover .card-icon,
.pm-radio-card.selected .card-icon {
    background: var(--brand);
    color: #fff;
}

.card-body {
    flex: 1;
}
.card-body strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}
.card-body small {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

/* custom radio indicator */
.card-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.pm-radio-card.selected .card-check {
    border-color: var(--brand);
    background: var(--brand);
}
.card-check::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    opacity: 0;
    transition: opacity var(--transition);
}
.pm-radio-card.selected .card-check::after {
    opacity: 1;
}

/* ─── SPECIFIC SERVICES GRID ──────────────────── */
.pm-services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}

/* Minimum-service error */
.pm-service-err {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 10px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #ef4444;
    line-height: 1.5;
}

/* Shake animation for the grid when validation fails */
@keyframes pmShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}
.pm-shake {
    animation: pmShake .45s ease;
}

.pm-check-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--surface);
    user-select: none;
}
.pm-check-card:hover {
    border-color: var(--brand);
    background: var(--brand-lite);
}
.pm-check-card.checked {
    border-color: var(--brand);
    background: var(--brand-lite);
}
.pm-check-card input[type="checkbox"] {
    display: none;
}

.check-box {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.pm-check-card.checked .check-box {
    background: var(--brand);
    border-color: var(--brand);
}
.check-box svg {
    opacity: 0;
    transition: opacity var(--transition);
}
.pm-check-card.checked .check-box svg {
    opacity: 1;
}

.check-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
}

/* ─── CONTACT FIELDS ──────────────────────────── */
.pm-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.pm-field {
    position: relative;
}
.pm-field.full {
    grid-column: 1 / -1;
}

.pm-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
}
.pm-field label .req {
    color: var(--accent);
    margin-left: 2px;
}

.pm-field input,
.pm-field textarea {
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--radius-sm) !important;
    border: 2px solid var(--border) !important;
    background: var(--surface);
    font-size: 14px;
    color: var(--text);
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    appearance: none;
    box-sizing: border-box;
}
.pm-field input:focus,
.pm-field textarea:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px var(--brand-lite);
}
.pm-field textarea {
    resize: none;
    min-height: 90px;
}

/* ─── PHONE FIELD ─────────────────────────────── */
/*
 * .pm-phone-wrap looks exactly like a regular <input>:
 * same border, same bg, same focus ring.
 * The country toggle sits inside as an inline prefix,
 * separated by only a thin internal divider — no separate background.
 */
.pm-phone-wrap {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    position: relative;
    transition: border-color var(--transition), box-shadow var(--transition);
    overflow: visible;              /* allow dropdown to escape */
    box-sizing: border-box;
}
.pm-phone-wrap:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-lite);
}

/* country toggle — inline prefix, no separate background */
.phone-country-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px 0 16px;        /* same horizontal padding as input */
    background: transparent;       /* matches input background */
    border-right: 1.5px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
    transition: background var(--transition);
    white-space: nowrap;
}
.phone-country-btn:hover {
    background: var(--brand-lite);
    border-radius:6px;
}

.flag-emoji {
    font-size: 18px;
    line-height: 1;
}
.dial-code {
    font-size: 14px;               /* same as input font-size */
    font-weight: 600;
    color: var(--text);
}
.chevron {
    font-size: 10px;
    color: var(--muted);
    transition: transform var(--transition);
    margin-left: 2px;
}
.phone-country-btn.open .chevron {
    transform: rotate(180deg);
}

/* 2-country dropdown */
.country-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 230px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 9999;
    display: none;
    overflow: hidden;
}
.country-dropdown.open {
    display: block;
    animation: pmFadeUp .2s ease;
}
.country-list {
    padding: 6px;
}
.country-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.country-option:hover  { background: var(--brand-lite); }
.country-option.active { background: var(--brand-lite); color: var(--brand); font-weight: 600; }
.country-option .flag-emoji { font-size: 18px; }
.country-name { flex: 1; }
.country-dial { font-size: 12px; font-weight: 600; color: var(--muted); }

/* phone text input — frameless, inherits from wrapper */
.phone-input-field {
    flex: 1;
    padding: 13px 16px;            /* same padding as .pm-field input */
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    min-width: 0;
    box-sizing: border-box;
}
.phone-input-field::placeholder {
    color: #b0b8d0;                /* same as other placeholders */
}

/* ─── ERROR STATES ────────────────────────────── */
.pm-err-msg {
    font-size: 12px;
    color: var(--error);
    margin-top: 5px;
    display: none;
}
.pm-field.has-error .pm-err-msg {
    display: block;
}
.pm-field.has-error input,
.pm-field.has-error textarea {
    border-color: var(--error);
}
.pm-field.has-error .pm-phone-wrap {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

/* ─── BUTTONS ROW ─────────────────────────────── */
.pm-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    gap: 12px;
    flex-wrap: wrap;
}

/* When there's only one button (Continue on step 1), push it right */
.pm-buttons--end {
    justify-content: flex-end;
}

/* ── Liquid button wrapper ── */
.pm-liquid-wrap {
    display: inline-flex;
}

/* ── Disabled state for liquid buttons ── */
.pm-liquid-wrap button:disabled,
.pm-liquid-wrap button[disabled] {
    opacity: .45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;    /* blocks liquid hover animation */
    box-shadow: none !important;
    transform: none !important;
}

/* Prevent the liquid blob animation firing on disabled */
.pm-liquid-wrap button:disabled .liquid-animation-stage,
.pm-liquid-wrap button[disabled] .liquid-animation-stage {
    display: none;
}

/* ── Keep legacy pm-btn classes working if used elsewhere ── */
.pm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all var(--transition);
}
.pm-btn-primary              { background: var(--brand);      color: #fff; margin-left: auto; }
.pm-btn-primary:hover        { background: var(--brand-dark); transform: translateY(-1px); }
.pm-btn-primary:disabled     { opacity: .45; cursor: not-allowed; transform: none; }
.pm-btn-ghost                { background: transparent; color: var(--brand); border: 2px solid var(--border); }
.pm-btn-ghost:hover          { border-color: var(--brand); background: var(--brand-lite); }
.btn-arrow                   { font-size: 16px; transition: transform var(--transition); }
.pm-btn-primary:not(:disabled):hover .btn-arrow { transform: translateX(3px); }

/* ─── SUCCESS STATE ───────────────────────────── */
.pm-success {
    display: none;
    text-align: center;
    padding: 48px 24px 40px;
    animation: pmFadeUp .4s ease;
}
.pm-success.active {
    display: block;
}
.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #dcfce7;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #16a34a;
    font-weight: 700;
}
.pm-success h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 10px;
}
.pm-success p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
}

/* ─── RESPONSIVE ──────────────────────────────── */
@media (max-width: 640px) {
    .form-inner {
        padding: 28px 20px 32px;
    }
    .pm-fields-grid {
        grid-template-columns: 1fr;
    }
    .pm-field.full {
        grid-column: 1;
    }
    .pm-services-grid {
        grid-template-columns: 1fr;
    }
    .pm-step-track {
        min-width: 32px;
    }
    .pm-buttons {
        flex-wrap: wrap;
    }
    .pm-btn-primary {
        width: 100%;
        justify-content: center;
        order: 1;
    }
    .pm-btn-ghost {
        width: 100%;
        justify-content: center;
        order: 2;
        margin-left: 0;
    }
    .country-dropdown {
        width: 200px;
    }
}