:root {
    --primary: #6C63FF;
    --primary-dark: #564FD8;
    --primary-light: #EDEBFF;
    --bg: #F7F7FC;
    --text: #262639;
    --text-muted: #6B6B80;
    --border: #E4E3F1;
    --success: #2E7D6B;
    --error: #D64545;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(60, 60, 120, 0.08);
    --shadow-hover: 0 16px 40px rgba(60, 60, 120, 0.16);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: linear-gradient(180deg, #F1F0FB 0%, #F7F7FC 40%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ---------- Header ---------- */

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.brand-icon {
    font-size: 1.5rem;
}

/* ---------- Main / Footer ---------- */

.site-main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.site-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 24px 16px;
}

/* ---------- Hero ---------- */

.hero {
    text-align: center;
    margin-bottom: 36px;
}

.hero h1 {
    font-size: 1.9rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* ---------- Groups grid ---------- */

.groups-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .groups-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .groups-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.group-square {
    --group-color: #6C63FF;
    aspect-ratio: 1 / 1;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.group-square:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--group-color);
}

.group-icon {
    font-size: 2.1rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--group-color) 15%, white);
}

.group-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.4;
}

/* ---------- Steps indicator ---------- */

.booking-container {
    max-width: 780px;
    margin: 0 auto;
}

.card-wide {
    max-width: 100%;
}

.steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #fff;
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 999px;
}

.step span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--border);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.step.active {
    color: var(--primary-dark);
    border-color: var(--primary);
    font-weight: 700;
}

.step.active span {
    background: var(--primary);
}

.step.done span {
    background: var(--success);
}

.step.done {
    color: var(--success);
}

/* ---------- Card ---------- */

.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    border: 1px solid var(--border);
}

.card h2 {
    margin-top: 0;
    font-size: 1.4rem;
    font-weight: 800;
}

.subtitle {
    color: var(--text-muted);
    margin-top: -8px;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.group-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ---------- Forms ---------- */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.92rem;
}

.form-control {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    background: #FCFCFF;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.field-error {
    color: var(--error);
    font-size: 0.85rem;
    display: block;
    margin-top: 6px;
}

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error {
    background: #FDECEC;
    color: var(--error);
    border: 1px solid #F6C4C4;
}

.alert-error ul {
    margin: 0;
    padding-inline-start: 18px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
}

.form-actions.center {
    justify-content: center;
}

.btn-primary, .btn-secondary {
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px 28px;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    color: #fff;
    box-shadow: 0 6px 16px rgba(108, 99, 255, 0.35);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(108, 99, 255, 0.45);
}

.btn-primary:disabled {
    background: #C9C7E8;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
}

/* ---------- Calendar ---------- */

.datetime-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 8px;
}

@media (max-width: 700px) {
    .datetime-grid {
        grid-template-columns: 1fr;
    }
}

.calendar-panel, .slots-panel {
    background: #FCFCFF;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.cal-nav-btn {
    background: var(--primary-light);
    border: none;
    color: var(--primary-dark);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.cal-nav-btn:hover {
    background: var(--primary);
    color: #fff;
}

.month-year-label {
    font-weight: 700;
    font-size: 1rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 0.88rem;
    cursor: pointer;
    background: #fff;
    border: 1.5px solid transparent;
    transition: all 0.12s ease;
}

.cal-day:hover:not(.disabled):not(.empty) {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.cal-day.today {
    border-color: var(--primary-light);
    font-weight: 700;
}

.cal-day.selected {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.cal-day.disabled {
    color: #CFCFE0;
    cursor: not-allowed;
}

.cal-day.empty {
    cursor: default;
}

.slots-panel h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.selected-date-label {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.slots-loading {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 340px;
    overflow-y: auto;
}

.slot-box {
    padding: 10px 6px;
    text-align: center;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-size: 0.85rem;
    cursor: pointer;
    background: #fff;
    transition: all 0.12s ease;
    direction: ltr;
}

.slot-box:hover:not(.unavailable) {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.slot-box.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
}

.slot-box.unavailable {
    color: #CFCFE0;
    background: #F4F4F9;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* ---------- Summary ---------- */

.summary-box {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 20px;
    margin-bottom: 24px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.summary-value {
    font-weight: 700;
    font-size: 0.95rem;
}

.confirm-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-light);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    cursor: pointer;
}

.confirm-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ---------- Success page ---------- */

.success-card {
    text-align: center;
}

.success-icon {
    font-size: 3.5rem;
    margin-bottom: 8px;
}
