﻿/**
 * Way Inscription Booking Form — Wizard styles.
 * Loaded only on pages with [amk_booking_form] shortcode.
 */

.amk-form {
    max-width: 640px;
    margin: 32px auto;
    padding: 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    position: relative;
}

/* Progress bar */
.amk-form__progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.amk-form__step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.amk-form__step-indicator.active,
.amk-form__step-indicator.done {
    opacity: 1;
}

.amk-form__step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    transition: background 0.2s, color 0.2s;
}

.amk-form__step-indicator.active .amk-form__step-num {
    background: #2563eb;
    color: #fff;
}

.amk-form__step-indicator.done .amk-form__step-num {
    background: #16a34a;
    color: #fff;
}

.amk-form__step-label {
    font-size: 0.7rem;
    color: #64748b;
    text-align: center;
}

/* Steps */
.amk-form__step h3 {
    font-size: 1.2rem;
    margin: 0 0 16px;
    color: #1e293b;
}

/* Select */
.amk-form__select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center;
    margin-bottom: 12px;
}

/* Input */
.amk-form__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.amk-form__input:focus,
.amk-form__select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Fieldset */
.amk-form__fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin: 0 0 16px;
}

.amk-form__fieldset legend {
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    padding: 0 8px;
}

/* Course cards */
.amk-form__courses,
.amk-form__groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.amk-form__course-card,
.amk-form__group-card {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.amk-form__course-card:hover,
.amk-form__group-card:hover {
    border-color: #93c5fd;
    background: #f0f9ff;
}

.amk-form__course-card.selected,
.amk-form__group-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
}

.amk-form__course-meta {
    font-size: 0.8rem;
    color: #64748b;
}

.amk-form__course-price {
    margin-left: auto;
    font-weight: 700;
    color: #1e293b;
}

.amk-form__seats {
    font-size: 0.8rem;
    color: #16a34a;
    margin-left: auto;
}

/* Trial option */
.amk-form__trial-label {
    display: block;
    margin: 12px 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: #475569;
}

/* Buttons */
.amk-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.amk-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.amk-btn--next,
.amk-btn--submit {
    background: #2563eb;
    color: #fff;
}

.amk-btn--next:hover:not(:disabled),
.amk-btn--submit:hover:not(:disabled) {
    background: #1d4ed8;
}

.amk-btn--prev {
    background: #f1f5f9;
    color: #475569;
}

.amk-btn--prev:hover {
    background: #e2e8f0;
}

.amk-btn--outline {
    background: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.amk-btn--outline:hover {
    background: #eff6ff;
}

.amk-btn--remove {
    background: transparent;
    color: #dc2626;
    border: none;
    font-size: 0.8rem;
    padding: 4px 8px;
    cursor: pointer;
}

.amk-btn--remove:hover {
    text-decoration: underline;
}

/* Navigation row */
.amk-form__nav {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 12px;
}

/* Consents */
.amk-form__consents {
    margin: 16px 0;
}

.amk-form__consent {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
}

.amk-form__consent a {
    color: #2563eb;
}

/* Discount text */
.amk-form__discount {
    font-size: 0.82rem;
    color: #64748b;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 16px 0;
}

/* Summary */
.amk-form__summary {
    margin-bottom: 16px;
}

.amk-summary__section {
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Error */
.amk-form__error {
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 12px;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 6px;
}

/* Success */
.amk-form__success {
    text-align: center;
    padding: 40px 20px;
}

.amk-form__success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.amk-form__success-msg {
    font-size: 1.1rem;
    color: #1e293b;
}

/* Responsive */
@media (max-width: 600px) {
    .amk-form {
        margin: 16px;
        padding: 16px;
    }

    .amk-form__step-label {
        display: none;
    }

    .amk-form__nav {
        flex-direction: column;
    }

    .amk-btn {
        width: 100%;
    }
}

/* 1.2.0 — каталог из CRM: идущие группы, цены, состояние «временно недоступно» */
.amk-form__group-card--ongoing {
    border-style: dashed;
}
.amk-form__ongoing {
    display: block;
    font-size: 0.85em;
    opacity: 0.85;
}
.amk-form__group-price {
    display: block;
    font-weight: 600;
}
.amk-form__groups-note,
.amk-form__notice {
    padding: 12px 16px;
    border-radius: 8px;
    background: #fff7ed;
    border: 1px solid #fdba74;
}

/* 1.3.0 — три шага (PLAN_FORM_UX §3): подписи над селектами, honeypot классом */
.amk-form__label {
    display: block;
    margin-bottom: 12px;
}
.amk-form__label > span {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}
.amk-form__label .amk-form__select,
.amk-form__label .amk-form__input {
    margin-bottom: 0;
}
/* 1.3.1 — дата рождения тремя списками: день / месяц / год в одну строку. */
.amk-form__birth {
    display: flex;
    gap: 8px;
}
.amk-form__birth .amk-form__select {
    margin-bottom: 0;
    min-width: 0;
    flex: 1 1 0;
}
.amk-form__birth .amk-child-birth-m {
    flex: 1.6 1 0;
}
.amk-form__select:disabled {
    background-color: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}
.amk-form__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.amk-form__groups-note {
    margin: 0 0 12px;
    font-size: 0.85rem;
}
.amk-form__child .amk-btn--remove {
    display: block;
    margin-top: 6px;
}
.amk-summary__section strong {
    color: #1e293b;
}

/* 1.3.0 — pop-up (PLAN_FORM_UX §4.1): нативный <dialog>, десктоп — окно ~720px, телефон — на весь экран */
.amk-modal {
    padding: 0;
    border: none;
    border-radius: 12px;
    width: min(720px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100vh - 48px);
    background: #fff;
    color: inherit;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
}
.amk-modal::backdrop {
    background: rgba(15, 23, 42, 0.55);
}
.amk-modal__body {
    position: relative;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
    box-sizing: border-box;
}
.amk-modal .amk-form {
    margin: 0;
    border: none;
    max-width: none;
}
.amk-modal__close {
    position: absolute;
    top: 10px;
    right: 14px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    font-size: 1.4rem;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}
.amk-modal__close:hover {
    background: #e2e8f0;
}
html.amk-modal-open {
    overflow: hidden;
}
@media (max-width: 640px) {
    .amk-modal {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }
    .amk-modal__body {
        max-height: 100vh;
        max-height: 100dvh;
        height: 100%;
        padding: 4px;
    }
    .amk-modal .amk-form {
        margin: 0;
        padding: 48px 16px 24px;
    }
}

/* Кнопка записи [amk_booking_button] (§4.2) — ссылка, стилизованная под amk-btn */
a.amk-btn--cta {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    width: auto;
}
a.amk-btn--cta:hover {
    background: #1d4ed8;
    color: #fff;
}
