/* ═══════════════════════════════════════════════════════════════
   Autopesula Broneerimine – Puhtax Light Theme v1.2.0
   Värvid: valge taust + roheline aktsent (Puhtax brand)
═══════════════════════════════════════════════════════════════ */

.ab-wrap *,
.ab-wrap *::before,
.ab-wrap *::after { box-sizing: border-box; }

.ab-wrap {
    /* ── Brand colours ── */
    --c-green:      #22c55e;
    --c-green-dk:   #16a34a;
    --c-green-lt:   rgba(34, 197, 94, .10);
    --c-green-bd:   rgba(34, 197, 94, .28);
    --c-red:        #ef4444;
    --c-red-lt:     rgba(239, 68, 68, .08);
    --c-amber:      #f59e0b;

    /* ── Light surfaces ── */
    --c-bg:         #ffffff;
    --c-surface:    #f8fafc;
    --c-surface2:   #f1f5f9;
    --c-border:     #e2e8f0;
    --c-border-lt:  #cbd5e1;

    /* ── Text ── */
    --c-text:       #111827;
    --c-text-muted: #6b7280;
    --c-text-dim:   #9ca3af;

    /* ── Misc ── */
    --radius:       10px;
    --shadow:       0 1px 6px rgba(0,0,0,.07);
    --shadow-lg:    0 4px 20px rgba(0,0,0,.10);

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: var(--c-text);
    line-height: 1.5;
    max-width: 1060px;
    margin: 0 auto;
    padding: 8px 0;
    background: var(--c-bg);
}

/* ── Progress bar ───────────────────────────────────────────── */
.ab-progress {
    display: flex;
    align-items: center;
    margin-bottom: 28px;
    padding: 0 2px;
}
.ab-progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity .3s;
}
.ab-progress-step .ab-prog-label { color: var(--c-text-dim); }
.ab-progress-step.ab-step-active .ab-prog-label { color: var(--c-text); font-weight: 600; }
.ab-step-done .ab-prog-label { color: var(--c-text-muted); }

.ab-prog-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--c-surface2);
    border: 1.5px solid var(--c-border-lt);
    color: var(--c-text-dim);
    font-size: 13px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: all .3s;
    flex-shrink: 0;
}
.ab-step-active .ab-prog-circle {
    background: var(--c-green);
    border-color: var(--c-green);
    color: #fff;
    box-shadow: 0 0 12px rgba(34,197,94,.30);
}
.ab-step-done .ab-prog-circle {
    background: var(--c-green-dk);
    border-color: var(--c-green-dk);
    color: #fff;
}
.ab-prog-label {
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
}
.ab-progress-line {
    flex: 1;
    height: 1px;
    background: var(--c-border);
    margin: 0 14px;
    min-width: 20px;
}

/* ── Step 1 layout ──────────────────────────────────────────── */
.ab-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    align-items: start;
}
@media (max-width: 680px) {
    .ab-layout { grid-template-columns: 1fr; }
}

/* ── Logo ───────────────────────────────────────────────────── */
.ab-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--c-border);
}
.ab-logo {
    max-width: 160px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ── Services panel ─────────────────────────────────────────── */
.ab-services-col {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.ab-col-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--c-text-muted);
    margin: 0 0 14px;
}

/* Category filter */
.ab-cat-filter { margin-bottom: 10px; }
.ab-wrap .ab-cat-select {
    width: 100% !important;
    padding: 6px 10px !important;
    border: 1.5px solid var(--c-border) !important;
    border-radius: 8px !important;
    background: var(--c-bg) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--c-text) !important;
    cursor: pointer !important;
    outline: none !important;
    box-shadow: none !important;
    appearance: auto !important;
}

/* service chips */
#ab-services-list { display: flex; flex-direction: column; gap: 5px; }
.ab-svc-hidden { display: none !important; }

.ab-svc-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid var(--c-border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
    user-select: none;
    background: var(--c-bg);
}
.ab-svc-chip:hover {
    border-color: var(--c-green-bd);
    background: var(--c-green-lt);
}
.ab-svc-chip.ab-selected {
    border-color: var(--c-green);
    background: var(--c-green-lt);
    box-shadow: 0 0 0 3px rgba(34,197,94,.10);
}
.ab-svc-check {
    width: 18px; height: 18px;
    border: 1.5px solid var(--c-border-lt);
    border-radius: 4px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
    background: var(--c-bg);
}
.ab-selected .ab-svc-check {
    background: var(--c-green);
    border-color: var(--c-green);
}
.ab-svc-check-icon { width: 10px; height: 10px; display: none; }
.ab-selected .ab-svc-check-icon { display: block; }

.ab-svc-name {
    font-size: 13.5px;
    font-weight: 500;
    flex: 1;
    color: var(--c-text);
}
.ab-svc-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    gap: 1px;
}
.ab-svc-dur {
    font-size: 11px;
    color: var(--c-text-muted);
    white-space: nowrap;
}
.ab-svc-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-green-dk);
    white-space: nowrap;
}

/* duration bar */
.ab-duration-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--c-green-lt);
    border: 1px solid var(--c-green-bd);
    border-radius: 8px;
    font-size: 13px;
    color: var(--c-green-dk);
    font-weight: 600;
}
.ab-duration-bar svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Calendar panel ─────────────────────────────────────────── */
.ab-calendar-col {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Day nav */
.ab-day-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface);
}
.ab-wrap .ab-nav-arrow {
    width: 36px; height: 36px;
    border: 2px solid #94a3b8 !important;
    border-radius: 50% !important;
    background: #fff !important;
    cursor: pointer;
    display: flex !important; align-items: center; justify-content: center;
    color: #1f2937 !important;
    flex-shrink: 0;
    transition: all .15s;
    box-shadow: 0 1px 4px rgba(0,0,0,.10);
    padding: 0 !important;
}
.ab-wrap .ab-nav-arrow svg {
    width: 18px; height: 18px;
    display: block;
    pointer-events: none;
}
.ab-wrap .ab-nav-arrow svg path {
    stroke: #1f2937;
    stroke-width: 2.5;
}
.ab-wrap .ab-nav-arrow:hover {
    border-color: var(--c-green) !important;
    background: var(--c-green-lt) !important;
    color: var(--c-green-dk) !important;
    box-shadow: 0 2px 8px rgba(34,197,94,.20);
}
.ab-wrap .ab-nav-arrow:hover svg path { stroke: var(--c-green-dk); }
.ab-nav-arrow:disabled,
.ab-nav-arrow[data-disabled] {
    opacity: .35;
    cursor: default;
    pointer-events: none;
}
.ab-day-label {
    flex: 1;
    text-align: center;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--c-text);
}
.ab-day-shortcuts { display: flex; gap: 6px; flex-shrink: 0; }
.ab-shortcut {
    padding: 5px 12px;
    border: 1.5px solid var(--c-border);
    border-radius: 20px;
    background: var(--c-bg);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--c-text-muted);
    transition: all .15s;
}
.ab-shortcut:hover {
    background: var(--c-green);
    border-color: var(--c-green);
    color: #fff;
}
.ab-wrap .ab-shortcut-find {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 5px 12px !important;
    border: 1.5px solid var(--c-border) !important;
    border-radius: 20px !important;
    background: var(--c-bg) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--c-text-muted) !important;
    box-shadow: none !important;
    text-decoration: none !important;
    outline: none !important;
}
.ab-wrap .ab-shortcut-find:hover {
    background: var(--c-green) !important;
    border-color: var(--c-green) !important;
    color: #fff !important;
    box-shadow: none !important;
}

/* Find first slot bar */
.ab-find-slot-bar {
    display: none;
    padding: 10px 16px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface);
    text-align: center;
}
.ab-find-slot-bar.ab-visible { display: block; }

.ab-btn-find-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 18px;
    height: 36px;
    background: #1f2937;
    border: none;
    border-radius: 7px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.ab-btn-find-slot svg { width: 15px; height: 15px; flex-shrink: 0; }
.ab-btn-find-slot:hover {
    background: #111827;
}
.ab-btn-find-slot:disabled {
    opacity: .6;
    cursor: default;
}

/* Grid area */
.ab-grid-area { padding: 0; min-height: 260px; }

.ab-hint-msg,
.ab-loading,
.ab-no-slots {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 260px;
    color: var(--c-text-dim);
    font-size: 14px;
    padding: 24px;
    text-align: center;
}
.ab-hint-msg svg, .ab-no-slots svg { width: 36px; height: 36px; opacity: .3; }

/* Slot grid */
.ab-slot-grid { display: grid; }

.ab-grid-head { display: contents; }
.ab-grid-head-cell {
    background: var(--c-surface2);
    color: var(--c-text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 10px 14px;
    text-align: center;
    border-bottom: 1px solid var(--c-border);
}
.ab-grid-head-cell:first-child { background: var(--c-surface); }
.ab-grid-head-cell:not(:first-child) {
    color: var(--c-green-dk);
    border-bottom: 2px solid var(--c-green);
}

.ab-grid-body { display: contents; }
.ab-grid-row  { display: contents; }

.ab-time-cell {
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text-muted);
    padding: 0 14px;
    display: flex;
    align-items: center;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    height: 46px;
}
.ab-slot-cell {
    border-bottom: 1px solid var(--c-border);
    border-left: 1px solid var(--c-border);
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    background: var(--c-bg);
}

.ab-slot-btn {
    width: 100% !important;
    height: 34px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all .15s !important;
    letter-spacing: .03em !important;
    text-transform: uppercase !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1 !important;
    box-shadow: none !important;
    outline: none !important;
}
.ab-wrap .ab-slot-free {
    background: var(--c-bg) !important;
    color: var(--c-text-muted) !important;
    border: 1.5px solid var(--c-border) !important;
}
.ab-wrap .ab-slot-free:hover {
    background: var(--c-green) !important;
    color: #fff !important;
    border-color: var(--c-green) !important;
}
.ab-slot-booked {
    background: var(--c-surface2);
    color: var(--c-text-dim);
    border: 1px solid var(--c-border);
    cursor: default;
    font-size: 11px;
}

/* Flash animation for find-first-slot */
@keyframes ab-slot-flash {
    0%   { background: rgba(34,197,94,.25); }
    100% { background: var(--c-bg); }
}
.ab-slot-grid.ab-flash .ab-slot-cell {
    animation: ab-slot-flash .8s ease-out;
}

/* ── Chosen summary (step 2) ────────────────────────────────── */
.ab-chosen-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--c-green-lt);
    border: 1px solid var(--c-green-bd);
    border-radius: var(--radius);
}
.ab-summary-chip {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-green-dk);
    display: flex;
    align-items: center;
    gap: 6px;
}
.ab-summary-chip + .ab-summary-chip {
    padding-left: 14px;
    border-left: 1px solid var(--c-green-bd);
}

/* ── Contact form ───────────────────────────────────────────── */
.ab-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
}
@media (max-width: 520px) { .ab-form-grid { grid-template-columns: 1fr; } }

/* ── Mobile: day nav wraps so "Esimene vaba aeg" stays visible ── */
@media (max-width: 560px) {
    .ab-day-nav {
        flex-wrap: wrap;
        gap: 6px;
        justify-content: space-between;
    }
    .ab-day-label {
        order: -1;
        width: 100%;
        text-align: center;
        flex: none;
    }
    .ab-day-shortcuts {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

.ab-field { display: flex; flex-direction: column; gap: 6px; }
.ab-field-full { grid-column: 1 / -1; }

.ab-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.ab-req { color: var(--c-green-dk); }

.ab-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: var(--c-bg);
    border: 1.5px solid var(--c-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--c-text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
    -webkit-appearance: none;
}
.ab-input::placeholder { color: var(--c-text-dim); }
.ab-input:focus {
    border-color: var(--c-green);
    box-shadow: 0 0 0 3px rgba(34,197,94,.10);
}
.ab-input.ab-invalid {
    border-color: var(--c-red);
    box-shadow: 0 0 0 3px rgba(239,68,68,.08);
}
.ab-uppercase { text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.ab-textarea  { height: auto; padding: 12px 14px; resize: vertical; }

select.ab-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.ab-err { font-size: 12px; color: var(--c-red); min-height: 16px; }

/* ── Promo code field ───────────────────────────────────────── */
.ab-promo-wrap {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: center;
}
.ab-promo-input { flex: 1; }
.ab-wrap .ab-promo-validate {
    height: 44px !important;
    padding: 0 16px !important;
    background: var(--c-surface2) !important;
    border: 1.5px solid var(--c-border) !important;
    border-radius: 8px !important;
    color: var(--c-text-muted) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: all .15s !important;
    flex-shrink: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    outline: none !important;
}
.ab-wrap .ab-promo-validate:hover {
    border-color: var(--c-green) !important;
    color: var(--c-green-dk) !important;
    background: var(--c-green-lt) !important;
    box-shadow: none !important;
}
.ab-promo-status {
    font-size: 12.5px;
    font-weight: 600;
    min-height: 18px;
}
.ab-promo-ok  { color: var(--c-green-dk); }
.ab-promo-err { color: var(--c-red); }

/* ── Form actions ───────────────────────────────────────────── */
.ab-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--c-border);
}

/* ── Buttons ────────────────────────────────────────────────── */
.ab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 24px;
    height: 46px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all .15s;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ab-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.ab-wrap .ab-btn-submit {
    background: var(--c-green) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 10px rgba(34,197,94,.28) !important;
    text-decoration: none !important;
    outline: none !important;
}
.ab-wrap .ab-btn-submit:hover {
    background: var(--c-green-dk) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 18px rgba(34,197,94,.38) !important;
    transform: translateY(-1px);
}
.ab-wrap .ab-btn-submit:disabled { opacity: .6 !important; cursor: default !important; transform: none !important; }

.ab-wrap .ab-btn-back {
    background: transparent !important;
    color: var(--c-text-muted) !important;
    border: 1.5px solid var(--c-border) !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}
.ab-wrap .ab-btn-back:hover {
    border-color: var(--c-border-lt) !important;
    color: var(--c-text) !important;
    background: var(--c-surface2) !important;
}

.ab-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.ab-btn-new {
    background: var(--c-green);
    color: #fff !important;
    font-weight: 700;
}
.ab-btn-new:hover { background: var(--c-green-dk); }

.ab-btn-home {
    text-decoration: none !important;
}

/* ── Spinner ────────────────────────────────────────────────── */
.ab-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--c-border);
    border-top-color: var(--c-green);
    border-radius: 50%;
    animation: ab-spin .7s linear infinite;
}
.ab-spinner-sm {
    width: 16px; height: 16px;
    border-width: 2px;
    border-color: rgba(255,255,255,.3);
    border-top-color: #fff;
    display: inline-block;
    vertical-align: middle;
}
@keyframes ab-spin { to { transform: rotate(360deg); } }

/* ── Confirmation ───────────────────────────────────────────── */
.ab-confirm {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 52px 24px;
    text-align: center;
}
.ab-confirm-icon { width: 72px; height: 72px; margin-bottom: 20px; }
.ab-confirm-icon svg { width: 100%; height: 100%; }

.ab-confirm-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--c-text);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ab-confirm-sub {
    font-size: 14px;
    color: var(--c-text-muted);
    margin: 0 0 28px;
}
.ab-confirm-details {
    background: var(--c-green-lt);
    border: 1px solid var(--c-green-bd);
    border-radius: var(--radius);
    padding: 20px 28px;
    font-size: 14.5px;
    color: var(--c-green-dk);
    line-height: 2;
    min-width: 280px;
    text-align: left;
}
.ab-confirm-details strong {
    display: block;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .02em;
    margin-bottom: 6px;
    color: var(--c-text);
}

/* ── Pane fade-in ───────────────────────────────────────────── */
.ab-pane { animation: ab-fadein .2s ease; }
@keyframes ab-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
