/* ================================================
 *  Custom CSS - Card Layanan & Progress Bar
 * ================================================ */

/* ── Progress Bar ───────────────────────────── */
.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--slate-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.progress-steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.progress-step {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--slate-200);
    color: var(--slate-500);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* ── Layanan Grid ────────────────────────────── */
.layanan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 640px) {
    .layanan-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ── Layanan Card ────────────────────────────── */
.layanan-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.layanan-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.12);
    transform: translateY(-4px);
}

.layanan-card.selected {
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.03));
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.25);
    transform: scale(1.02);
}

.layanan-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.layanan-card__icon {
    font-size: 2.75rem;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.layanan-card.selected .layanan-card__icon {
    transform: scale(1.1);
}

.layanan-card__content {
    flex: 1;
    min-width: 0;
}

.layanan-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.35rem 0;
    letter-spacing: -0.01em;
}

.layanan-card__desc {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.layanan-card__check {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border: 2.5px solid #cbd5e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    background: #fff;
}

.layanan-card__check svg {
    width: 14px;
    height: 14px;
    stroke: white;
    stroke-width: 3;
    fill: none;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.layanan-card.selected .layanan-card__check {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-color: #3b82f6;
    transform: scale(1.1);
}

.layanan-card.selected .layanan-card__check svg {
    opacity: 1;
    transform: scale(1);
}

/* ── Selected Layanan Display ────────────────── */
.selected-layanan {
    padding: 1.25rem;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
}

.selected-layanan__label {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 0.75rem 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.selected-layanan__items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selected-layanan__tag {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1rem;
    background: white;
    color: #3b82f6;
    border: 2px solid #3b82f6;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

/* ── Selected Layanan Mini (Step 3) ──────────── */
.selected-layanan-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.layanan-tag-mini {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #93c5fd;
}

/* ── Success Summary ─────────────────────────── */
.success__summary {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 12px;
    border: 2px solid #86efac;
}

.success__summary-label {
    font-size: 0.8rem;
    color: #166534;
    margin: 0 0 0.75rem 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.success__layanan-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.success__layanan-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: white;
    color: #16a34a;
    border: 2px solid #86efac;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ── Form Actions ────────────────────────────── */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions .btn--secondary {
    order: -1;
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn--secondary {
        order: 1;
        width: 100%;
    }

    .form-actions .btn--primary {
        width: 100%;
    }
}

/* ── Button Large ────────────────────────────── */
.btn--large {
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
    font-weight: 600;
}

/* ── Focus Styles for Accessibility ───────────── */
.layanan-card:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* ── Step Content Transitions ─────────────────── */
.step-content {
    animation: fadeIn 0.4s ease;
}

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

/* ── Emo Grid Selected State Override ───────────── */
/* Support both .selected and --selected classes */
.emo-grid__item.selected,
.emo-grid__item--selected {
    border-color: #3b82f6 !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1)) !important;
    transform: scale(1.1) translateY(-5px) !important;
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.3) !important;
}

.emo-grid__item.selected .emo-grid__face,
.emo-grid__item--selected .emo-grid__face {
    transform: scale(1.3) !important;
    filter: drop-shadow(0 6px 12px rgba(59, 130, 246, 0.3)) !important;
}

.emo-grid__item.selected .emo-grid__label,
.emo-grid__item--selected .emo-grid__label {
    color: #1d4ed8 !important;
    font-weight: 700 !important;
}

/* ── Flying Cards Animation ───────────────────── */
.flying-cards-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.flying-card {
    position: absolute;
    width: 320px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: slideFromRight linear forwards;
    transform: translateY(-50%);
}

@keyframes slideFromRight {
    0% {
        opacity: 0;
        left: 120%;
        transform: translateY(-50%) scale(0.95);
    }
    5% {
        opacity: 0.7;
        transform: translateY(-50%) scale(1);
    }
    95% {
        opacity: 0.7;
        transform: translateY(-50%) scale(1);
    }
    100% {
        opacity: 0;
        left: -20%;
        transform: translateY(-50%) scale(0.95);
    }
}

.flying-card__content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flying-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.flying-card__name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flying-card__stars {
    font-size: 0.75rem;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.flying-card__comment {
    font-size: 0.85rem;
    color: #1e293b;
    line-height: 1.4;
    font-style: italic;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    padding: 0.625rem 0.875rem;
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
}

.flying-card__layanan {
    font-size: 0.7rem;
    color: #3b82f6;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Warna rating bintang */
.flying-card__stars[data-rating="1"] { color: #ef4444; }
.flying-card__stars[data-rating="2"] { color: #f97316; }
.flying-card__stars[data-rating="3"] { color: #f59e0b; }
.flying-card__stars[data-rating="4"] { color: #22c55e; }
.flying-card__stars[data-rating="5"] { color: #22c55e; }
