/* ============ CHA Public — Modern UI ============ */
.cha-public-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
}
.cha-glass-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 36px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.4);
    margin-bottom: 30px;
}

/* ---- Buttons ---- */
.cha-btn-gradient {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff !important;
    border: none;
    border-radius: 10px;
    padding: 10px 22px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: transform .15s ease, box-shadow .15s ease;
}
.cha-btn-gradient:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,99,235,.45); }

/* ---- Stepper ---- */
.cha-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.cha-stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: .45;
    transition: opacity .3s ease;
}
.cha-stepper-item.active { opacity: 1; }
.cha-stepper-dot {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    transition: all .3s ease;
}
.cha-stepper-item.active .cha-stepper-dot {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,.4);
}
.cha-stepper-item.done .cha-stepper-dot { background: #10b981; color: #fff; }
.cha-stepper-label { font-size: .78rem; font-weight: 600; color: #475569; }
.cha-stepper-line {
    width: 60px; height: 3px;
    border-radius: 3px;
    background: #e2e8f0;
    margin-bottom: 18px;
}

/* ---- Wizard ---- */
.cha-wizard-step { display: none; }
.cha-wizard-step.active { display: block; animation: chaFadeIn 0.4s; }
@keyframes chaFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Whole lab vs equipment choice cards ---- */
.cha-choice-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.cha-choice-card { flex: 1; min-width: 220px; cursor: pointer; margin: 0; }
.cha-choice-card input { display: none; }
.cha-choice-inner {
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    height: 100%;
    transition: all .15s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cha-choice-inner i { font-size: 1.4rem; color: #64748b; }
.cha-choice-inner small { color: #64748b; }
.cha-choice-card input:checked + .cha-choice-inner {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 4px 14px rgba(37,99,235,.15);
}
.cha-choice-card input:checked + .cha-choice-inner i { color: #2563eb; }

.cha-equipment-box { background: #f8fafc; border-color: #e2e8f0 !important; border-radius: 12px !important; }
.cha-equipment-check { padding: 6px 0 6px 1.8em; border-bottom: 1px dashed #e2e8f0; }
.cha-equipment-check:last-child { border-bottom: none; }

/* ---- Phone prefix ---- */
.cha-phone-prefix { max-width: 240px; flex: 1; }

/* ---- Success ---- */
.cha-success-icon {
    width: 72px; height: 72px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    font-size: 2.2rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(16,185,129,.4);
    animation: chaPop .4s ease;
}
@keyframes chaPop {
    from { transform: scale(.4); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ---- Calendar filters ---- */
.cha-cal-filter {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 999px;
    padding: 7px 16px;
    font-weight: 600;
    font-size: .85rem;
    color: #475569;
    transition: all .15s ease;
    cursor: pointer;
}
.cha-cal-filter:hover { border-color: #cbd5e1; transform: translateY(-1px); }
.cha-cal-filter.active { background: #0f172a; border-color: #0f172a; color: #fff; }
.cha-cal-filter.active.cha-filter-lab       { background: #10b981; border-color: #10b981; }
.cha-cal-filter.active.cha-filter-equipment { background: #3b82f6; border-color: #3b82f6; }
.cha-cal-filter.active.cha-filter-room      { background: #f59e0b; border-color: #f59e0b; }
.cha-cal-filter.active.cha-filter-vehicle   { background: #8b5cf6; border-color: #8b5cf6; }

.cha-legend-dot { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:3px; }
.cha-legend-pending  { background: rgba(16,185,129,.55); }
.cha-legend-approved { background: #10b981; }

/* ---- FullCalendar theme ---- */
#cha-fullcalendar { --fc-border-color: #eef2f7; }
#cha-fullcalendar .fc-toolbar-title { font-size: 1.25rem; font-weight: 700; color: #0f172a; }
#cha-fullcalendar .fc-button {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-weight: 600;
    border-radius: 8px !important;
    margin: 0 2px;
    box-shadow: none;
    text-transform: capitalize;
}
#cha-fullcalendar .fc-button:hover { background: #f1f5f9; color: #0f172a; }
#cha-fullcalendar .fc-button-active,
#cha-fullcalendar .fc-button-primary:not(:disabled).fc-button-active {
    background: #0f172a !important;
    border-color: #0f172a !important;
    color: #fff !important;
}
#cha-fullcalendar .fc-daygrid-day.fc-day-today { background: #eff6ff; }
#cha-fullcalendar .fc-col-header-cell-cushion { font-weight: 700; color: #475569; font-size: .8rem; text-transform: uppercase; }
#cha-fullcalendar .fc-event {
    border-radius: 6px;
    border: none;
    padding: 2px 6px;
    font-size: .8em;
    font-weight: 600;
    cursor: pointer;
    transition: transform .1s ease, box-shadow .1s ease;
}
#cha-fullcalendar .fc-event:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.18); }
#cha-fullcalendar .fc-daygrid-more-link { font-weight: 600; color: #2563eb; }
#cha-fullcalendar .fc-list-event:hover td { background: #f8fafc; }

.cha-event-modal-content { border: none; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }

/* ---- Resource cards ---- */
.cha-resource-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.cha-resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

@media (max-width: 576px) {
    .cha-glass-panel { padding: 22px 16px; }
    .cha-stepper-line { width: 26px; }
    .cha-phone-prefix { max-width: 150px; }
}

/* ============== Custom phone flag dropdown ============== */
.cha-phone-row { display: flex; gap: 8px; align-items: stretch; }
.cha-phone-input { flex: 1; min-width: 0; }
.cha-flag-dropdown { position: relative; }
.cha-flag-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px; height: 100%;
    background: #fff; border: 1px solid #ced4da; border-radius: 8px;
    cursor: pointer; min-width: 120px; transition: all .15s;
}
.cha-flag-btn:hover { border-color: #2563eb; }
.cha-flag-img {
    width: 24px; height: 18px; object-fit: cover; border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.08); flex-shrink: 0;
}
.cha-flag-dial { font-weight: 600; color: #1f2937; font-size: 14px; }
.cha-flag-caret { margin-left: auto; color: #6b7280; font-size: 12px; }
.cha-flag-panel {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 1050;
    width: 320px; max-width: 90vw;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    display: none; overflow: hidden;
}
.cha-flag-panel.open { display: block; }
.cha-flag-search-wrap {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-bottom: 1px solid #f3f4f6; color: #6b7280;
}
.cha-flag-search {
    border: none; outline: none; flex: 1; font-size: 14px; background: transparent;
}
.cha-flag-list {
    list-style: none; margin: 0; padding: 4px 0;
    max-height: 280px; overflow-y: auto;
}
.cha-flag-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; cursor: pointer; font-size: 14px;
    transition: background .12s;
}
.cha-flag-item:hover { background: #f3f4f6; }
.cha-flag-item-img {
    width: 24px; height: 18px; object-fit: cover; border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.08); flex-shrink: 0;
}
.cha-flag-item-name { flex: 1; color: #1f2937; }
.cha-flag-item-dial { color: #6b7280; font-weight: 600; }
.cha-flag-empty {
    padding: 16px; text-align: center; color: #9ca3af; font-size: 14px;
}
@media (max-width: 540px) {
    .cha-flag-panel { width: 280px; }
}

/* ============== Locked-resource banner (shortcode pre-selection) ============== */
.cha-locked-banner {
    display: flex; align-items: flex-start; gap: 14px;
    background: linear-gradient(135deg, #eff6ff, #ede9fe);
    border: 1px solid #c7d2fe; border-radius: 12px;
    padding: 16px 18px; margin-bottom: 20px;
}
.cha-locked-banner > i.bi {
    font-size: 28px; color: #2563eb; flex-shrink: 0; margin-top: 2px;
}
.cha-locked-label {
    font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
    color: #6b7280; font-weight: 600;
}
.cha-locked-name {
    font-size: 20px; font-weight: 700; color: #1f2937;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 2px;
}
.cha-locked-cat { font-size: 11px !important; padding: 2px 10px !important; }
.cha-locked-desc { color: #4b5563; font-size: 14px; margin-top: 4px; }
.cha-cat-pill { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.cha-cat-pill.cha-cat-laboratory { background: #d1fae5; color: #065f46; }
.cha-cat-pill.cha-cat-equipment  { background: #dbeafe; color: #1e40af; }
.cha-cat-pill.cha-cat-room       { background: #fef3c7; color: #92400e; }
.cha-cat-pill.cha-cat-vehicle    { background: #ede9fe; color: #5b21b6; }
