/* ================================================================
   Add Property — full custom design (no jQuery.steps sidebar)
   ================================================================ */

/* ── Page shell ─────────────────────────────────────────────── */
.apf-page {
    min-height: 100vh;
    background: #f0f2f5;
    font-family: inherit;
}

/* ── Page header ─────────────────────────────────────────────── */
.apf-page-header {
    background: #fff;
    border-bottom: 1px solid #ececec;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    padding-top: 28px;
}

.apf-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.apf-logo {
    height: 44px;
    width: auto;
    flex-shrink: 0;
}

.apf-brand-text { flex: 1; }

.apf-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px;
    line-height: 1.25;
}

.apf-page-sub {
    font-size: .85rem;
    color: #6c757d;
    margin: 0;
}

/* ── Step progress bar ──────────────────────────────────────── */
.apf-steps-wrap {
    padding: 0 0 0;
    overflow: hidden;
}

.apf-steps-track {
    display: flex;
    align-items: center;
    padding: 0 8px;
}

/* Each step item */
.apf-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: default;
    flex-shrink: 0;
}

/* Bubble */
.apf-step-bubble {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid #d8dde6;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: border-color .3s, background .3s, box-shadow .3s;
    font-size: 20px;
    color: #b0b8c4;
}

.apf-step-item.is-active .apf-step-bubble {
    border-color: #0e159b;
    background: linear-gradient(135deg, #0e159b, #a72d5d);
    color: #fff;
    box-shadow: 0 4px 14px rgba(14,21,155,.35);
}

.apf-step-item.is-done .apf-step-bubble {
    border-color: #1c9100;
    background: #1c9100;
    color: #fff;
    box-shadow: 0 2px 8px rgba(28,145,0,.25);
}

/* Icon states */
.apf-s-icon  { transition: opacity .2s; }
.apf-s-check { display: none; font-size: 18px; }
.apf-s-number { display: none; }

.apf-step-item:not(.is-active):not(.is-done) .apf-s-icon { opacity: .5; }
.apf-step-item.is-done .apf-s-icon  { display: none; }
.apf-step-item.is-done .apf-s-check { display: block; }

/* Label */
.apf-step-label {
    font-size: 11px;
    font-weight: 600;
    color: #adb5bd;
    white-space: nowrap;
    letter-spacing: .3px;
    padding-bottom: 12px;
    transition: color .3s;
}

.apf-step-item.is-active .apf-step-label { color: #0e159b; }
.apf-step-item.is-done   .apf-step-label { color: #1c9100; }

/* Connector line between steps */
.apf-step-line {
    flex: 1;
    height: 2px;
    background: #d8dde6;
    margin-bottom: 30px; /* align with center of bubble */
    border-radius: 2px;
    transition: background .4s;
    min-width: 10px;
}

.apf-step-line.is-done { background: #1c9100; }

/* Mobile counter (hidden on desktop) */
.apf-mobile-counter {
    display: none;
    font-size: .8rem;
    color: #6c757d;
    padding: 6px 0 12px;
    margin: 0;
}

/* ── Card body ──────────────────────────────────────────────── */
.apf-page-body {
    padding: 32px 0 60px;
}

.apf-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 28px rgba(0,0,0,.08);
    overflow: hidden;
}

/* Thin progress strip at very top of card */
.apf-card-bar {
    height: 4px;
    background: #f0f2f5;
}

.apf-card-bar-fill {
    height: 100%;
    background: linear-gradient(44deg, #282c5f, #b3063e);
    border-radius: 0 4px 4px 0;
    transition: width .4s ease;
}

/* Panel header */
.apf-panel-header {
    padding: 28px 32px 0;
    border-bottom: 1px solid #f5f5f5;
    margin-bottom: 28px;
}

.apf-panel-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px;
}

.apf-panel-sub {
    font-size: .875rem;
    color: #6c757d;
    margin: 0 0 20px;
}

/* Global alert */
.apf-alert {
    margin: 0 32px 20px;
    border-radius: 10px;
    font-size: .9rem;
}

/* ── Panels ─────────────────────────────────────────────────── */
.apf-panel {
    display: none;
    padding: 0 32px;
    animation: apfFadeIn .25s ease;
}

.apf-panel.is-active { display: block; }

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

/* ── Form fields ─────────────────────────────────────────────── */
.apf-field-group {
    margin-bottom: 22px;
}

.apf-label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.apf-req  { color: #a72d5d; margin-left: 2px; }
.apf-opt  { font-weight: 400; color: #9ca3af; font-size: .8rem; }

.apf-input {
    display: block;
    width: 100%;
    padding: 11px 15px;
    border: 1.5px solid #dde2ec;
    border-radius: 10px;
    font-size: .9rem;
    color: #1f2937;
    background: #fafbfc;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    -moz-appearance: textfield;
}

.apf-input::-webkit-outer-spin-button,
.apf-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.apf-input:focus {
    border-color: #0e159b;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(14,21,155,.12);
}

.apf-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.apf-char-count {
    font-size: .75rem;
    color: #9ca3af;
    text-align: right;
    margin-top: 4px;
}

/* Input with icon */
.apf-input-icon-wrap {
    position: relative;
}

.apf-input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #9ca3af;
    pointer-events: none;
    transition: color .2s;
}

.apf-input-icon-wrap .apf-input {
    padding-left: 42px;
}

.apf-input-icon-wrap:focus-within .apf-input-icon { color: #0e159b; }

/* Input with suffix (MAD, m²) */
.apf-input-suffix-wrap {
    display: flex;
    align-items: stretch;
}

.apf-input-suffix-wrap .apf-input {
    border-radius: 10px 0 0 10px;
    border-right: none;
}

.apf-input-suffix {
    padding: 0 14px;
    background: #f3f4f6;
    border: 1.5px solid #dde2ec;
    border-left: none;
    border-radius: 0 10px 10px 0;
    font-size: .85rem;
    font-weight: 600;
    color: #6b7280;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* ── Transaction toggle (Vente / Location) ──────────────────── */
.apf-toggle-row {
    display: flex;
    gap: 14px;
}

.apf-toggle {
    flex: 1;
    cursor: pointer;
    margin: 0;
}

.apf-toggle input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

.apf-toggle-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 18px 12px;
    border: 2px solid #dde2ec;
    border-radius: 12px;
    background: #fafbfc;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}

.apf-toggle-face i {
    font-size: 26px;
    color: #9ca3af;
    transition: color .2s;
}

.apf-toggle-face strong {
    font-size: .95rem;
    color: #374151;
    display: block;
}

.apf-toggle-face small {
    font-size: .78rem;
    color: #9ca3af;
}

.apf-toggle input:checked + .apf-toggle-face {
    border-color: #0e159b;
    background: #f0f2ff;
    box-shadow: 0 0 0 3px rgba(14,21,155,.1);
}

.apf-toggle input:checked + .apf-toggle-face i     { color: #0e159b; }
.apf-toggle input:checked + .apf-toggle-face strong { color: #0e159b; }

/* ── Category grid ──────────────────────────────────────────── */
.apf-cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.apf-cat-card {
    cursor: pointer;
    margin: 0;
}

.apf-cat-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

.apf-cat-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    border: 2px solid #dde2ec;
    border-radius: 12px;
    background: #fafbfc;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}

.apf-cat-face i {
    font-size: 28px;
    color: #9ca3af;
    transition: color .2s, transform .2s;
}

.apf-cat-face span {
    font-size: .8rem;
    font-weight: 600;
    color: #6b7280;
    transition: color .2s;
}

.apf-cat-card input:checked + .apf-cat-face {
    border-color: #0e159b;
    background: #f0f2ff;
    box-shadow: 0 0 0 3px rgba(14,21,155,.1);
}

.apf-cat-card input:checked + .apf-cat-face i    { color: #0e159b; transform: scale(1.1); }
.apf-cat-card input:checked + .apf-cat-face span { color: #0e159b; }

.apf-cat-card:hover .apf-cat-face {
    border-color: #c0c8d4;
    background: #f4f6f9;
}

/* ── Row layouts ────────────────────────────────────────────── */
.apf-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.apf-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ── Counter stepper ────────────────────────────────────────── */
.apf-counter {
    display: flex;
    align-items: center;
    border: 1.5px solid #dde2ec;
    border-radius: 10px;
    overflow: hidden;
    background: #fafbfc;
}

.apf-counter-btn {
    width: 40px;
    height: 44px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    transition: background .15s, color .15s;
    flex-shrink: 0;
    line-height: 1;
}

.apf-counter-btn:hover { background: #f3f4f6; color: #0e159b; }

.apf-counter-input {
    flex: 1;
    border: none;
    text-align: center;
    font-size: .9rem;
    font-weight: 600;
    color: #1f2937;
    background: transparent;
    padding: 0;
    width: 0;
    outline: none;
    -moz-appearance: textfield;
}

.apf-counter-input::-webkit-outer-spin-button,
.apf-counter-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── Drop zone ──────────────────────────────────────────────── */
.apf-photos-hint {
    font-size: .82rem;
    color: #6b7280;
    background: #f8f9fc;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 20px;
    border-left: 3px solid #0e159b;
}

.apf-photos-hint i { color: #0e159b; margin-right: 4px; }

.apf-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 14px;
    padding: 46px 20px;
    text-align: center;
    background: #fafbfc;
    cursor: pointer;
    transition: all .25s;
    margin-bottom: 18px;
    position: relative;
}

.apf-dropzone:hover,
.apf-dropzone.drag-over {
    border-color: #0e159b;
    background: #f0f2ff;
}

.apf-dropzone-inner { pointer-events: none; }

.apf-drop-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e3ff, #eef0ff);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.apf-drop-icon i {
    font-size: 32px;
    color: #0e159b;
}

.apf-drop-label {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 6px;
}

.apf-drop-sub {
    font-size: .8rem;
    color: #9ca3af;
    margin: 0 0 14px;
}

.apf-browse-btn {
    pointer-events: all;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    background: linear-gradient(44deg, #282c5f, #b3063e);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .15s;
}

.apf-browse-btn:hover {
    opacity: .88;
    transform: translateY(-1px);
}

/* Image preview grid */
.apf-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.apf-preview-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 10px;
    overflow: hidden;
    background: #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.apf-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.apf-remove-img {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background .15s;
    backdrop-filter: blur(4px);
}

.apf-remove-img:hover { background: rgba(167,45,93,.9); }

.apf-featured-badge {
    position: absolute;
    bottom: 7px;
    left: 7px;
    background: linear-gradient(44deg, #282c5f, #b3063e);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Upload progress */
.apf-upload-progress { margin-top: 14px; }

.apf-prog-track {
    height: 6px;
    background: #e9ecef;
    border-radius: 99px;
    overflow: hidden;
}

.apf-prog-fill {
    height: 100%;
    background: linear-gradient(44deg, #282c5f, #b3063e);
    border-radius: 99px;
    transition: width .3s ease;
}

.apf-prog-label {
    font-size: .78rem;
    color: #6b7280;
    margin: 5px 0 0;
}

/* ── Privacy note / submit note ─────────────────────────────── */
.apf-privacy-note,
.apf-submit-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: .8rem;
    color: #6b7280;
    background: #f8f9fc;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 8px;
}

.apf-privacy-note i,
.apf-submit-note i {
    font-size: 18px;
    color: #1c9100;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Summary ────────────────────────────────────────────────── */
.apf-summary {
    background: #f8f9fc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.apf-summary-section {
    margin-bottom: 18px;
}

.apf-summary-section:last-child { margin-bottom: 0; }

.apf-summary-section-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #9ca3af;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
}

.apf-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 5px 0;
    font-size: .875rem;
}

.apf-summary-key {
    color: #6b7280;
    flex-shrink: 0;
    margin-right: 12px;
}

.apf-summary-val {
    font-weight: 600;
    color: #1f2937;
    text-align: right;
}

.apf-summary-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0e159b;
}

/* ── Navigation buttons ─────────────────────────────────────── */
.apf-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 32px 28px;
    border-top: 1px solid #f5f5f5;
    margin-top: 12px;
    gap: 12px;
}

.apf-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .2s;
    white-space: nowrap;
}

.apf-btn:disabled,
.apf-btn.is-loading { opacity: .65; cursor: not-allowed; }

.apf-btn-ghost {
    background: transparent;
    border: 1.5px solid #d1d5db;
    color: #4b5563;
}

.apf-btn-ghost:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.apf-btn-primary {
    background: linear-gradient(44deg, #282c5f, #b3063e);
    color: #fff;
    box-shadow: 0 4px 14px rgba(14,21,155,.3);
}

.apf-btn-primary:hover:not(:disabled) {
    opacity: .88;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(14,21,155,.35);
}

.apf-btn-submit {
    background: linear-gradient(135deg, #1c9100, #28c500);
    color: #fff;
    box-shadow: 0 4px 14px rgba(28,145,0,.3);
    padding: 13px 32px;
    font-size: .95rem;
}

.apf-btn-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #177a00, #1c9100);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(28,145,0,.35);
}

/* ── RTL ────────────────────────────────────────────────────── */
[dir="rtl"] .apf-input-icon { left: auto; right: 13px; }
[dir="rtl"] .apf-input-icon-wrap .apf-input { padding-left: 15px; padding-right: 42px; }
[dir="rtl"] .apf-featured-badge { left: auto; right: 7px; }
[dir="rtl"] .apf-remove-img     { right: auto; left: 7px; }
[dir="rtl"] .apf-photos-hint    { border-left: none; border-right: 3px solid #0e159b; }
[dir="rtl"] .apf-char-count     { text-align: left; }
[dir="rtl"] .apf-btn i.fa-arrow-right { order: -1; transform: scaleX(-1); }
[dir="rtl"] .apf-btn i.fa-arrow-left  { order: 1;  transform: scaleX(-1); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .apf-panel-header { padding: 20px 20px 0; }
    .apf-panel        { padding: 0 20px; }
    .apf-nav          { padding: 18px 20px 24px; }
    .apf-alert        { margin: 0 20px 16px; }
    .apf-page-title   { font-size: 1.1rem; }
    .apf-brand        { flex-direction: column; align-items: flex-start; gap: 10px; }

    .apf-step-bubble  { width: 38px; height: 38px; font-size: 16px; }
    .apf-step-label   { display: none; }
    .apf-mobile-counter { display: block; }

    .apf-cat-grid     { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .apf-cat-face     { padding: 12px 6px; gap: 6px; }
    .apf-cat-face i   { font-size: 22px; }
    .apf-cat-face span { font-size: .72rem; }

    .apf-toggle-face  { padding: 14px 8px; }
    .apf-toggle-face i { font-size: 22px; }

    .apf-row-2        { grid-template-columns: 1fr 1fr; gap: 12px; }
    .apf-row-3        { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .apf-counter-btn  { width: 34px; }
    .apf-dropzone     { padding: 32px 16px; }
    .apf-preview-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

@media (max-width: 480px) {
    .apf-step-bubble { width: 32px; height: 32px; font-size: 14px; }
    .apf-row-2 { grid-template-columns: 1fr; }
    .apf-btn   { padding: 10px 18px; font-size: .85rem; }
    .apf-cat-grid { grid-template-columns: repeat(2, 1fr); }
    .apf-toggle-row { flex-direction: column; }
}

/* jQuery UI autocomplete override */
.ui-autocomplete {
    border: 1.5px solid #0e159b !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.12) !important;
    font-size: .88rem !important;
    z-index: 9999 !important;
}

.ui-menu-item-wrapper {
    padding: 8px 14px !important;
    color: #374151 !important;
}

.ui-menu-item-wrapper.ui-state-active {
    background: #f0f2ff !important;
    color: #0e159b !important;
    border: none !important;
    border-radius: 6px !important;
    margin: 2px 4px !important;
}
