/* ==========================================================================
   Randevu sihirbazı ve randevu onay sayfası
   --------------------------------------------------------------------------
   Yalnızca /randevu ve /randevu/basarili sayfalarında yüklenir.
   Renk, boşluk ve yarıçap değerleri design-system.css değişkenlerinden gelir;
   burada yeni bir renk tanımlanmaz.

   Mobil öncelikli yazılmıştır: 375px genişlikte hiçbir öğe yatay taşma
   yaratmaz — ızgaralar minmax(min(...), 100%) ile daralır, adım göstergesinde
   dar ekranda yalnızca numaralar kalır.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Sayfa düzeni
   -------------------------------------------------------------------------- */

.wizard-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    align-items: start;
}

.wizard {
    min-width: 0;
    padding: var(--space-5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    box-shadow: var(--shadow-sm);
}

.wizard-aside {
    display: grid;
    gap: var(--space-5);
    min-width: 0;
}

.wizard-aside-title {
    margin-bottom: var(--space-2);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
}

.wizard-aside .card-body > .btn { margin-top: var(--space-3); }

@media (min-width: 992px) {
    .wizard-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    .wizard { padding: var(--space-8); }

    .wizard-aside { position: sticky; top: calc(var(--header-height) + var(--space-5)); }
}

/* --------------------------------------------------------------------------
   Adım göstergesi
   -------------------------------------------------------------------------- */

.wizard-progress { margin-bottom: var(--space-6); }

.wizard-progress-text {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2) var(--space-3);
    margin-bottom: var(--space-3);
}

.wizard-progress-count {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--primary-700);
}

.wizard-progress-title {
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-snug);
    color: var(--text-primary);
}

.wizard-progress-track {
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--surface-muted);
    overflow: hidden;
}

.wizard-progress-fill {
    display: block;
    width: 12.5%;
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary-500), var(--primary-700));
    transition: width var(--duration) var(--ease-out);
}

.wizard-steps {
    display: flex;
    gap: var(--space-1);
    margin: var(--space-4) 0 0;
    padding: 0;
    list-style: none;
}

.wizard-step {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    text-align: center;
}

.wizard-step-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--border-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    transition: background-color var(--duration) var(--ease-out),
                border-color var(--duration) var(--ease-out),
                color var(--duration) var(--ease-out);
}

.wizard-step-label {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.wizard-step.is-done .wizard-step-dot {
    border-color: var(--primary-300);
    background: var(--primary-100);
    color: var(--primary-800);
}

.wizard-step.is-current .wizard-step-dot {
    border-color: var(--primary-600);
    background: var(--primary-600);
    color: var(--text-on-primary);
    box-shadow: 0 0 0 4px var(--primary-100);
}

.wizard-step.is-current .wizard-step-label {
    color: var(--primary-800);
    font-weight: var(--weight-semibold);
}

/* Dar ekranda yalnızca numaralar kalır; sekiz etiket yan yana sığmaz. */
@media (max-width: 719px) {
    .wizard-step-label { display: none; }
    .wizard-step-dot { width: 26px; height: 26px; font-size: var(--text-xs); }
}

/* --------------------------------------------------------------------------
   Adım gövdesi
   -------------------------------------------------------------------------- */

.wizard-panel { display: block; }
.wizard-panel[hidden] { display: none; }

.wizard-heading {
    margin-bottom: var(--space-2);
    font-size: var(--text-2xl);
}

.wizard-heading:focus-visible {
    outline: 3px solid var(--primary-400);
    outline-offset: 4px;
    border-radius: var(--radius-xs);
}

.wizard-help {
    margin-bottom: var(--space-6);
    font-size: var(--text-base);
    color: var(--text-secondary);
}

/* Randevu sayfasında boş durum başlığı h2'dir (sayfada h1 kahramandadır);
   components.css yalnızca h3 için kural taşıdığından burada eşitlenir. */
.empty-state h2 {
    margin-bottom: 0;
    font-size: var(--text-xl);
    color: var(--ink-700);
}

.wizard-error:empty { display: none; }
.wizard-error .alert { margin-bottom: var(--space-5); }

.wizard-fields {
    display: grid;
    gap: var(--space-5);
}

.wizard-consents { margin-bottom: var(--space-6); }
.wizard-consents .form-check { margin-bottom: var(--space-5); }

/* Boş doğrulama metni yer kaplamamalı. */
.invalid-feedback[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Seçim kartları (kategori ve hizmet)
   -------------------------------------------------------------------------- */

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: var(--space-4);
}

.option-card { display: block; position: relative; cursor: pointer; }
.option-card[hidden] { display: none; }

.option-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.option-body {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    height: 100%;
    padding: var(--space-5);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    transition: border-color var(--duration-fast) var(--ease-out),
                background-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

.option-card:hover .option-body {
    border-color: var(--primary-300);
    background: var(--primary-050);
}

.option-input:focus-visible + .option-body {
    outline: 3px solid var(--primary-400);
    outline-offset: 2px;
}

.option-input:checked + .option-body {
    border-color: var(--primary-600);
    background: var(--primary-050);
    box-shadow: var(--shadow-sm);
}

.option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--primary-100);
    color: var(--primary-700);
    font-size: 1.25rem;
}

.option-input:checked + .option-body .option-icon {
    background: var(--primary-600);
    color: var(--text-on-primary);
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
    flex: 1;
}

.option-title {
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.option-desc {
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    color: var(--text-secondary);
}

.option-meta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-wide);
    color: var(--text-muted);
}

.option-check {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-600);
    color: var(--text-on-primary);
    font-size: 0.85rem;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity var(--duration-fast) var(--ease-out),
                transform var(--duration-fast) var(--ease-out);
}

.option-input:checked + .option-body .option-check {
    opacity: 1;
    transform: scale(1);
}

/* --------------------------------------------------------------------------
   Gün ve saat ızgarası
   -------------------------------------------------------------------------- */

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr));
    gap: var(--space-3);
}

.slot-grid-times {
    grid-template-columns: repeat(auto-fill, minmax(min(92px, 100%), 1fr));
}

.slot-group + .slot-group { margin-top: var(--space-6); }

.slot-group-title {
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--text-muted);
}

.slot-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: var(--space-3) var(--space-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--text-sm);
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease-out),
                background-color var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out);
}

.slot-tile:hover {
    border-color: var(--primary-400);
    background: var(--primary-050);
}

.slot-tile:focus-visible {
    outline: 3px solid var(--primary-400);
    outline-offset: 2px;
}

.slot-tile.is-selected {
    border-color: var(--primary-600);
    background: var(--primary-600);
    color: var(--text-on-primary);
}

.date-tile { min-height: 88px; }

.date-tile-day {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-wide);
    color: var(--text-muted);
}

.date-tile-date {
    font-size: var(--text-base);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-snug);
}

.date-tile-count {
    font-size: var(--text-2xs);
    color: var(--text-muted);
}

.date-tile.is-selected .date-tile-day,
.date-tile.is-selected .date-tile-count {
    color: rgba(255, 255, 255, 0.85);
}

.time-tile-value {
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    font-variant-numeric: tabular-nums;
}

/* Yükleniyor gösterimi — gerçek kutucuklarla aynı yüksekliktedir,
   böylece veri gelince sayfa zıplamaz. */
.skeleton-tile { height: 88px; border-radius: var(--radius); }

/* --------------------------------------------------------------------------
   Özet listeleri
   -------------------------------------------------------------------------- */

.summary-card {
    display: grid;
    gap: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-sunken);
    overflow: hidden;
}

.summary-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-1);
    padding: var(--space-4) var(--space-5);
}

.summary-row + .summary-row { border-top: 1px solid var(--border-subtle); }

.summary-row dt {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--text-muted);
}

.summary-row dd {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2) var(--space-3);
    margin: 0;
    min-width: 0;
}

.summary-value {
    font-weight: var(--weight-medium);
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.summary-note {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.summary-edit {
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary-700);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    text-decoration: underline;
    text-underline-offset: 0.18em;
    cursor: pointer;
}

.summary-edit:hover { color: var(--primary-800); }

.summary-edit:focus-visible {
    outline: 3px solid var(--primary-400);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

.summary-card-compact .summary-row { padding: var(--space-3) var(--space-4); }

/* --------------------------------------------------------------------------
   Son adım
   -------------------------------------------------------------------------- */

.final-card {
    padding: var(--space-6);
    margin-bottom: var(--space-5);
    border: 1.5px solid var(--primary-200);
    border-radius: var(--radius-md);
    background: var(--primary-050);
}

.final-service {
    margin-bottom: var(--space-1);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--primary-900);
}

.final-when {
    margin-bottom: var(--space-2);
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-snug);
    color: var(--primary-800);
}

.final-meta {
    margin-bottom: var(--space-1);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.wizard-submitting {
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface-sunken);
}

.wizard-submitting[hidden] { display: none; }
.wizard-submitting .wizard-help { margin: var(--space-4) 0 0; }

/* --------------------------------------------------------------------------
   Gezinme düğmeleri
   -------------------------------------------------------------------------- */

.wizard-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-8);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-subtle);
}

.wizard-nav .btn[hidden] { display: none; }

.wizard-nav [data-wizard-next],
.wizard-nav [data-wizard-submit] { margin-left: auto; }

@media (max-width: 559px) {
    .wizard-nav { flex-direction: column-reverse; }
    .wizard-nav .btn { width: 100%; margin-left: 0; }
}

/* --------------------------------------------------------------------------
   Onay sayfası
   -------------------------------------------------------------------------- */

.appt-success {
    text-align: center;
    margin-bottom: var(--space-8);
}

.appt-success .icon-badge { margin-bottom: var(--space-5); }
.appt-success .lead { margin-inline: auto; max-width: 46ch; }
.appt-success .alert { text-align: left; margin-top: var(--space-6); }

.appt-number-card {
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    border: 1.5px dashed var(--primary-300);
    border-radius: var(--radius-lg);
    background: var(--primary-050);
    text-align: center;
}

.appt-number-label {
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--primary-700);
}

.appt-number {
    margin-bottom: var(--space-4);
    font-size: clamp(1.5rem, 6vw, var(--text-3xl));
    font-weight: var(--weight-extrabold);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    color: var(--primary-900);
    overflow-wrap: anywhere;
    /* Numaranın elle seçilebilmesi kopyalama düğmesi çalışmasa da gerekir. */
    -webkit-user-select: all;
    user-select: all;
}

.appt-number-card .form-hint { margin-top: var(--space-3); }

.appt-number-card .btn.is-copied {
    --btn-fg: var(--success-600);
    --btn-border: var(--success-600);
}

.appt-address {
    margin: 0;
    font-style: normal;
}

.appt-actions { margin-top: var(--space-8); }

@media (max-width: 559px) {
    .appt-actions .btn { width: 100%; }
}
