/* ═══════════════════════════════════════════════════════
   Drive Me MGK – Frontend Booking Form Styles
   ═══════════════════════════════════════════════════════ */

.mgk-booking-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    color: #1a1a2e;
}

/* ── Progress Bar ─────────────────────────────────────── */
.mgk-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 36px;
    gap: 0;
    flex-wrap: wrap;
}

.mgk-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: default;
}

.mgk-step-num {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #dde3f0;
    color: #888;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border: 3px solid transparent;
}

.mgk-step.active .mgk-step-num {
    background: #003366;
    color: #fff;
    border-color: #003366;
    box-shadow: 0 0 0 4px rgba(0,51,102,0.15);
}

.mgk-step.completed .mgk-step-num {
    background: #00843d;
    color: #fff;
    border-color: #00843d;
}

.mgk-step.completed .mgk-step-num::after {
    content: '✓';
    font-size: 18px;
}

.mgk-step.completed .mgk-step-num { font-size: 0; }

.mgk-step-label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    white-space: nowrap;
}

.mgk-step.active .mgk-step-label  { color: #003366; }
.mgk-step.completed .mgk-step-label { color: #00843d; }

.mgk-step-line {
    height: 3px;
    width: 60px;
    background: #dde3f0;
    margin: 0 4px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

/* ── Notice ───────────────────────────────────────────── */
.mgk-notice {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}
.mgk-notice-error   { background: #fce8e6; border-left: 4px solid #d63638; color: #5c1c1c; }
.mgk-notice-warning { background: #fff8e6; border-left: 4px solid #f0a500; color: #5c3d00; }
.mgk-notice-info    { background: #e6f3ff; border-left: 4px solid #0073aa; color: #003d5c; }

/* ── Panels ───────────────────────────────────────────── */
.mgk-panel {
    display: none;
    animation: mgkFadeIn 0.25s ease;
}
.mgk-panel.active { display: block; }

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

.mgk-panel-title {
    font-size: 22px;
    font-weight: 700;
    color: #003366;
    margin: 0 0 6px;
}
.mgk-panel-sub {
    color: #666;
    margin: 0 0 24px;
    font-size: 14px;
}

.mgk-empty {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    color: #666;
    text-align: center;
}

/* ── Lesson Cards Grid ────────────────────────────────── */
.mgk-lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.mgk-lesson-card {
    background: #fff;
    border: 2px solid #dde3f0;
    border-radius: 12px;
    padding: 18px 16px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.mgk-lesson-card:hover:not(.full):not(.filtered-out) {
    border-color: #003366;
    box-shadow: 0 4px 16px rgba(0,51,102,0.12);
    transform: translateY(-2px);
}

.mgk-lesson-card.selected {
    border-color: #003366;
    background: #f0f6ff;
    box-shadow: 0 4px 16px rgba(0,51,102,0.15);
}

.mgk-lesson-card.selected::before {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 12px;
    background: #003366;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.mgk-lesson-card.full {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f9f9f9;
}

.mgk-lesson-card.filtered-out {
    display: none;
}

/* Card content */
.mgk-card-date {
    margin-bottom: 10px;
}
.mgk-card-day {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #003366;
    font-weight: 700;
    margin-bottom: 2px;
}
.mgk-card-dmy {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.1;
}
.mgk-card-time,
.mgk-card-location,
.mgk-card-teacher {
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mgk-card-price {
    font-size: 15px;
    font-weight: 700;
    color: #003366;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e8ecf5;
}
.mgk-card-slots {
    margin-top: 6px;
}
.mgk-badge-full {
    display: inline-block;
    background: #fce8e6;
    color: #d63638;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}
.mgk-badge-avail {
    display: inline-block;
    background: #d1f0d8;
    color: #0a6b2a;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

/* ── Navigation ───────────────────────────────────────── */
.mgk-nav {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
}

.mgk-btn {
    padding: 13px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    line-height: 1;
}

.mgk-btn-next,
.mgk-btn-checkout {
    background: #003366;
    color: #fff;
    border-color: #003366;
}
.mgk-btn-next:hover:not(:disabled),
.mgk-btn-checkout:hover:not(:disabled) {
    background: #004fa3;
    border-color: #004fa3;
}
.mgk-btn-next:disabled {
    background: #c0c8d8;
    border-color: #c0c8d8;
    cursor: not-allowed;
}
.mgk-btn-checkout {
    background: #00843d;
    border-color: #00843d;
    font-size: 16px;
    padding: 15px 32px;
}
.mgk-btn-checkout:hover:not(:disabled) {
    background: #006b31;
}
.mgk-btn-checkout:disabled {
    background: #c0c8d8;
    border-color: #c0c8d8;
    cursor: not-allowed;
}
.mgk-btn-back {
    background: transparent;
    color: #003366;
    border-color: #003366;
}
.mgk-btn-back:hover { background: #f0f6ff; }

/* ── Step 4: Summary ──────────────────────────────────── */
.mgk-summary {
    background: #f0f6ff;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 28px;
}
.mgk-summary h4 {
    margin: 0 0 16px;
    color: #003366;
    font-size: 16px;
}
.mgk-summary-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #dde3f0;
}
.mgk-summary-item:last-child { border-bottom: none; }
.mgk-summary-part {
    background: #003366;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}
.mgk-summary-detail {
    font-size: 14px;
    line-height: 1.5;
}
.mgk-summary-price {
    font-size: 16px;
    font-weight: 700;
    color: #003366;
    white-space: nowrap;
}
.mgk-summary-total {
    text-align: right;
    font-size: 16px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 2px solid #003366;
    color: #1a1a2e;
}
.mgk-summary-total strong {
    font-size: 22px;
    color: #003366;
}

/* ── Customer form ────────────────────────────────────── */
.mgk-customer-form {
    background: #f0f6ff;
    border: 2px solid #dde3f0;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 28px;
}
.mgk-customer-form h4 {
    color: #003366;
    font-size: 16px;
    margin: 0 0 16px;
}
.mgk-field-group {
    margin-bottom: 16px;
}
.mgk-field-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}
.mgk-field-group label .required { color: #d63638; }
.mgk-field-group input,
.mgk-field-group select {
    width: 100%;
    max-width: 100%;
    padding: 11px 14px;
    border: 2px solid #dde3f0;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.mgk-field-group input:focus,
.mgk-field-group select:focus {
    outline: none;
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0,51,102,0.08);
}
.mgk-field-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}
.mgk-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .mgk-lessons-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }
    .mgk-step-line { width: 30px; }
    .mgk-summary-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .mgk-field-row { grid-template-columns: 1fr; }
    .mgk-btn { padding: 11px 20px; font-size: 14px; }
    .mgk-panel-title { font-size: 18px; }
    .mgk-card-dmy { font-size: 17px; }
}

@media (max-width: 480px) {
    .mgk-lessons-grid { grid-template-columns: 1fr 1fr; }
    .mgk-step-label { display: none; }
    .mgk-step-line { width: 20px; }
}

/* ── FA-Number Reference Image Hint ──────────────────────────────────────── */
.mgk-fa-hint-trigger {
    display: inline-flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    margin-left: 6px;
    vertical-align: middle;
}
.mgk-fa-hint-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}
.mgk-fa-hint-trigger:hover .mgk-fa-hint-icon,
.mgk-fa-hint-trigger.is-open .mgk-fa-hint-icon {
    background: #1d4ed8;
}

/* ── Desktop popover (screens > 600px) ─────────────────────────────────── */
@media (min-width: 601px) {
    .mgk-fa-hint-popover {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        left: 50%;
        transform: translateX(-50%);
        z-index: 9999;
        background: #fff;
        border: 1px solid #dde3f0;
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.18);
        padding: 16px 16px 14px;
        width: 380px;
        font-size: 13px;
        color: #334155;
        text-align: center;
    }
    .mgk-fa-hint-popover::before {
        content: '';
        position: absolute;
        top: -7px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 7px solid transparent;
        border-right: 7px solid transparent;
        border-bottom: 7px solid #dde3f0;
    }
    .mgk-fa-hint-popover::after {
        content: '';
        position: absolute;
        top: -6px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: 6px solid #fff;
    }
    .mgk-fa-hint-trigger.is-open .mgk-fa-hint-popover {
        display: block;
    }
    .mgk-fa-hint-close {
        position: absolute;
        top: 8px;
        right: 10px;
        background: none;
        border: none;
        cursor: pointer;
        font-size: 16px;
        color: #94a3b8;
        padding: 2px 6px;
        line-height: 1;
    }
    .mgk-fa-hint-close:hover { color: #334155; }
}

/* ── Mobile: full-screen overlay modal (screens ≤ 600px) ─────────────────── */
@media (max-width: 600px) {
    /* The popover becomes a fixed full-screen overlay */
    .mgk-fa-hint-popover {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 99999;
        background: rgba(0,0,0,0.55);
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        width: 100%;
        text-align: center;
        /* flex centering for the inner card */
        align-items: center;
        justify-content: center;
    }
    .mgk-fa-hint-trigger.is-open .mgk-fa-hint-popover {
        display: flex;
    }
    /* Arrow hidden on mobile */
    .mgk-fa-hint-popover::before,
    .mgk-fa-hint-popover::after { display: none; }

    /* Inner card */
    .mgk-fa-hint-popover-inner {
        position: relative;
        background: #fff;
        border-radius: 16px;
        padding: 20px 16px 24px;
        width: calc(100vw - 32px);
        max-width: 420px;
        max-height: 88vh;
        overflow-y: auto;
        box-shadow: 0 16px 48px rgba(0,0,0,0.28);
        text-align: center;
    }

    .mgk-fa-hint-close {
        position: absolute;
        top: 12px;
        right: 14px;
        background: #f1f5f9;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        width: 32px;
        height: 32px;
        font-size: 18px;
        color: #475569;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        padding: 0;
    }
    .mgk-fa-hint-close:hover { background: #e2e8f0; color: #1e293b; }
}

/* Shared image style */
.mgk-fa-hint-img {
    display: block;
    width: 100%;
    max-width: 340px;
    height: auto;
    border-radius: 8px;
    margin: 12px auto 0;
    border: 1px solid #e2e8f0;
}

/* Inline link hint below field */
.mgk-fa-hint-link {
    display: inline-block;
    margin-left: 6px;
    color: #2563eb;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}
.mgk-fa-hint-link:hover { color: #1d4ed8; }

/* Prevent body scroll when mobile FA hint modal is open */
body.mgk-modal-open { overflow: hidden; }
