:root {
    /* One font stack reused everywhere — calendar / verify / done all match.
       Plus Jakarta Sans: geometric sans-serif with excellent Vietnamese diacritic
       rendering. Loaded from Google Fonts in meeting.html. */
    --font-stack: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html, body {
    min-height: 100%;
    margin: 0;
    font-family: var(--font-stack);
    background: #f4f7fb;
    color: #121212;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

button { font: inherit; }

.booking-page {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1rem 2rem;
}

.booking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: 24px;
    background: white;
    box-shadow: 0 24px 80px rgba(39, 42, 53, 0.08);
    margin-bottom: 1.5rem;
}

.brand {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.brand-icon {
    /* Default ("KS" text fallback): solid 54×54 gradient pill */
    min-width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, #1f6fe8 0%, #3e9fff 100%);
    display: grid;
    place-items: center;
    color: white;
    font-weight: 700;
    letter-spacing: 0.04em;
    overflow: hidden;
}

/* When a logo image is present, the box adapts to the image's natural aspect ratio.
   Height stays at 54px (header rhythm); width grows up to ~240px so wide logos look right. */
.brand-icon:has(img) {
    background: transparent;
    width: auto;
    min-width: 0;
    max-width: 240px;
    border-radius: 12px;
    padding: 0;
}

.brand-icon img {
    height: 100%;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    display: block;
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 700;
}

.brand-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
}

.booking-main {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(280px, 380px) minmax(380px, 1fr);
}

.booking-card,
.booking-calendar {
    background: white;
    border-radius: 28px;
    padding: 1.65rem;
    box-shadow: 0 16px 50px rgba(39, 42, 53, 0.08);
}

.profile-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: linear-gradient(135deg, #1f6fe8, #3e9fff);
    color: white;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    font-weight: 700;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 999px;
    background: #dff6ff;
    color: #0f64ba;
    font-size: 0.9rem;
}

.profile-role {
    color: #6b7280;
    font-size: 0.95rem;
}

.meeting-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: #f2f8ff;
    color: #0f4db4;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.details-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.95rem;
    align-items: center;
}

.detail-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #eef5ff;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.detail-label {
    color: #6b7280;
    font-size: 0.88rem;
    margin-bottom: 0.2rem;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
}

.booking-note {
    color: #475569;
    line-height: 1.75;
    margin: 0;
}

.calendar-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.calendar-header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.calendar-month {
    color: #6b7280;
    font-weight: 600;
}

.calendar-panel {
    padding: 1.25rem 1.25rem 1.5rem;
    border-radius: 24px;
    background: #f8fbff;
    margin-bottom: 1.5rem;
}

.weekday-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    text-align: center;
    gap: 0.35rem;
    color: #6b7280;
    letter-spacing: 0.12em;
    font-size: 0.84rem;
    margin-bottom: 0.85rem;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.day-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 0.75rem;
    border-radius: 18px;
    border: 1px solid #dbeafe;
    background: white;
    color: #111827;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    min-height: 64px;
}

.day-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.day-button.selected {
    background: #eff6ff;
    border-color: #93c5fd;
}

/* No bookable time-slots remain on this date (today past 10pm). */
.day-button.disabled {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.55;
    text-decoration: line-through;
}
.day-button.disabled:hover {
    transform: none;
    box-shadow: none;
}
.day-button.disabled .day-week,
.day-button.disabled .day-num { color: #9ca3af; }

.day-button .day-week {
    font-size: 11px;
    color: #6b7280;
    line-height: 1;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.day-button .day-num {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.time-panel { margin-bottom: 1.25rem; }

.time-panel h3 {
    margin: 0 0 1rem;
    font-size: 1.05rem;
}

.time-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.time-grid button {
    border: 1px solid #dbeafe;
    border-radius: 16px;
    padding: 0.95rem 0.9rem;
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.time-grid button.active {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #0f172a;
}

.time-grid button:hover { background: #eef2ff; }

.time-empty {
    padding: 1.25rem;
    text-align: center;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}

.selection-summary {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: #334155;
}

.continue-button {
    width: 100%;
    padding: 0.95rem 1rem;
    border: none;
    border-radius: 18px;
    background: #0f4db4;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.continue-button:hover { background: #0b41a8; }

/* ───── Booking form (step 2) ───── */
.booking-form {
    background: white;
    border-radius: 28px;
    padding: 1.65rem;
    box-shadow: 0 16px 50px rgba(39, 42, 53, 0.08);
}

.booking-form[hidden] { display: none !important; }

.back-button {
    background: none;
    border: none;
    color: #0f4db4;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    margin: -0.4rem 0 0.85rem -0.6rem;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.back-button:hover { background: #eff6ff; }

.form-header { margin-bottom: 1.5rem; }

.form-header h2 {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
}

.form-sub {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
}

.form-sub strong { color: #0f172a; }

.form-fields {
    display: grid;
    gap: 1.15rem;
}

.form-field { display: grid; gap: 0.45rem; }

.form-field label {
    font-weight: 600;
    font-size: 0.92rem;
    color: #1f2937;
}

.req { color: #dc2626; margin-left: 2px; }

.form-field input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #f8fbff;
    font-size: 0.98rem;
    color: #0f172a;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.form-field input::placeholder { color: #94a3b8; }

.form-field input:hover { border-color: #bfdbfe; }

.form-field input:focus {
    outline: none;
    border-color: #1f6fe8;
    background: white;
    box-shadow: 0 0 0 4px rgba(31, 111, 232, 0.12);
}

.form-field input.invalid {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
}

.field-hint {
    color: #6b7280;
    font-size: 0.82rem;
    line-height: 1.45;
}

.form-msg {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.5;
}

.form-msg.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.form-msg.success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.form-msg.loading {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #bae6fd;
    border-top-color: #0369a1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.loading-text strong {
    font-variant-numeric: tabular-nums;
    color: #0c4a6e;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ───── Booking verify (step 3) ───── */
.booking-verify {
    background: white;
    border-radius: 28px;
    padding: 2rem 1.8rem;
    box-shadow: 0 16px 50px rgba(39, 42, 53, 0.08);
    text-align: center;
}

.booking-verify[hidden] { display: none !important; }

.verify-header { margin-bottom: 1.75rem; text-align: center; }

.verify-shield {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #e8f0fe 0%, #d2e3fc 100%);
    color: #1a73e8;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 24px rgba(26, 115, 232, 0.18),
                inset 0 0 0 1px rgba(26, 115, 232, 0.12);
}

/* Legacy lock icon (kept so older JS/HTML paths still render). */
.verify-icon {
    width: 64px; height: 64px;
    margin: 0 auto 0.75rem;
    border-radius: 22px;
    background: linear-gradient(135deg, #1f6fe8, #3e9fff);
    color: white;
    display: grid; place-items: center;
    font-size: 1.65rem;
    box-shadow: 0 12px 30px rgba(31, 111, 232, 0.25);
}

.verify-header h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 500;
    color: #202124;
    letter-spacing: -0.01em;
}

.verify-sub {
    margin: 0;
    color: #5f6368;
    line-height: 1.55;
    font-size: 0.95rem;
}

.verify-summary {
    text-align: left;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 12px;
    padding: 0.4rem 0.25rem;
    margin: 1.5rem 0 1.5rem;
    display: grid;
}

/* ─── Verify checklist (replaces summary box; nudges user to the Google button) ─── */
.verify-checklist {
    list-style: none;
    margin: 1.5rem 0 1.25rem;
    padding: 0;
    display: grid;
    gap: 0;
    position: relative;
}

.vchk-step {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.9rem 1rem;
    border: 1px solid #e8eaed;
    background: #fff;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.vchk-step:first-child { border-radius: 12px 12px 0 0; border-bottom: 0; }
.vchk-step:last-child  { border-radius: 0 0 12px 12px; }
.vchk-step:only-child  { border-radius: 12px; }

/* Vertical connector between bullets */
.vchk-step + .vchk-step::before {
    content: '';
    position: absolute;
    left: calc(1rem + 15px);
    width: 2px;
    height: 14px;
    background: #dadce0;
    transform: translateY(-50%);
    margin-top: -0.9rem;
}

.vchk-bullet {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    position: relative;
}

/* DONE state — green check */
.vchk-step.done {
    background: #f6fbf8;
}
.vchk-step.done .vchk-bullet {
    background: #34a853;
    color: #fff;
}

/* ACTIVE state — pulsing blue ring + index number */
.vchk-step.active {
    background: linear-gradient(135deg, #eff6ff 0%, #e8f0fe 100%);
    border-color: #aecbfa;
    box-shadow: 0 1px 2px rgba(26, 115, 232, 0.08), 0 4px 16px rgba(26, 115, 232, 0.12);
}
.vchk-step.active .vchk-bullet {
    background: #1a73e8;
    color: #fff;
    font-weight: 600;
    font-size: 0.82rem;
    font-family: var(--font-stack);
}
.vchk-num { position: relative; z-index: 1; }
.vchk-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(26, 115, 232, 0.25);
    animation: vchkPulse 1.8s ease-out infinite;
    pointer-events: none;
}
@keyframes vchkPulse {
    0%   { transform: scale(0.85); opacity: 0.85; }
    100% { transform: scale(1.55); opacity: 0; }
}

.vchk-content {
    min-width: 0;
}
.vchk-title {
    font-family: var(--font-stack);
    font-weight: 500;
    color: #202124;
    font-size: 0.96rem;
    margin-bottom: 0.15rem;
}
.vchk-meta {
    font-size: 0.84rem;
    color: #5f6368;
}
.vchk-step.done .vchk-meta {
    color: #1e8e3e;
    font-weight: 500;
}

/* Arrow pointing down to the Google button */
.vchk-arrow {
    color: #1a73e8;
    animation: vchkArrowBounce 1.6s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes vchkArrowBounce {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50%      { transform: translateY(4px); opacity: 1; }
}

.verify-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.92rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f3f4;
}
.verify-summary-row:last-child { border-bottom: 0; }
.verify-summary-row[hidden] { display: none; }

.vsum-label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #5f6368;
    font-weight: 400;
}
.vsum-icon { color: #80868b; flex-shrink: 0; }
.verify-summary-row strong {
    color: #202124;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}
.vsum-pending { font-weight: 400 !important; color: #80868b !important; }
.vsum-placeholder { font-style: italic; font-size: 0.86rem; }

.google-signin-button {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid #dadce0;
    border-radius: 999px;            /* Material pill */
    background: #ffffff;
    color: #3c4043;                  /* fix: dark text on white (was invisible) */
    font-family: var(--font-stack);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    --mana-fill: 0%;
}

/* Mana fill INSIDE the button — matches verify-icon gradient (#1f6fe8 → #3e9fff).
   --mana-fill (0%–100%) is the target width.
   --mana-speed controls the transition duration (JS swaps 0s / 0.5s / 90s per phase). */
.google-signin-button::before {
    content: '';
    position: absolute;
    inset: 0;
    width: var(--mana-fill);
    background: linear-gradient(90deg, #3e9fff 0%, #2680f0 50%, #1f6fe8 100%);
    box-shadow: inset 0 0 16px rgba(31, 111, 232, 0.45);
    opacity: 0.78;
    transition: width var(--mana-speed, 2s) cubic-bezier(0.65, 0, 0.35, 1);
    z-index: 0;
    pointer-events: none;
}

/* Keep text + logo above the fill */
.google-signin-button > * {
    position: relative;
    z-index: 1;
}

/* Live mana percentage shown at the right edge of the button */
.google-signin-button .mana-percent {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    color: #0c4a6e;
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.15);
    z-index: 2;
    pointer-events: none;
    letter-spacing: 0.02em;
    min-width: 38px;
    text-align: center;
}

.google-signin-button:hover:not(:disabled) {
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.16), 0 2px 6px rgba(60, 64, 67, 0.08);
    background: #f8faff;
    border-color: #c6d4ff;
}

.google-signin-button:active:not(:disabled) {
    background: #eef3ff;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.18);
}

.google-signin-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.32);
}

.google-signin-button:disabled {
    cursor: not-allowed;
    background: #f8fafc;
}

/* ── Gentle continuous side-to-side sway: signals "you can click now" ── */
.google-signin-button.flash {
    border-color: #0ea5e9;
    background: #f0f9ff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.22),
                0 6px 22px rgba(2, 132, 199, 0.35);
    animation: btnGentleSway 2.2s ease-in-out infinite;
}

@keyframes btnGentleSway {
    0%   { transform: translateX(0); }
    25%  { transform: translateX(-6px); }
    50%  { transform: translateX(0); }
    75%  { transform: translateX(6px); }
    100% { transform: translateX(0); }
}

.google-logo { flex-shrink: 0; width: 20px; height: 20px; }

.verify-security {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #5f6368;
    font-size: 0.78rem;
    line-height: 1;
    padding: 0.4rem 0.85rem;
    background: #f1f3f4;
    border-radius: 999px;
}
.verify-security svg { color: #1a73e8; flex-shrink: 0; }

.verify-note {
    margin: 1.15rem 0 0;
    color: #80868b;
    font-size: 0.82rem;
    line-height: 1.55;
    text-align: center;
}

/* ───── Booking done (step 4) ───── */
.booking-done {
    background: white;
    border-radius: 28px;
    padding: 2.25rem 1.8rem;
    box-shadow: 0 16px 50px rgba(39, 42, 53, 0.08);
    text-align: center;
}

.booking-done[hidden] { display: none !important; }

.done-icon {
    margin: 0 auto 1rem;
    width: 88px;
    height: 88px;
    border-radius: 999px;
    background: #ecfdf5;
    display: grid;
    place-items: center;
    animation: doneIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes doneIn {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.done-title {
    margin: 0 0 0.75rem;
    font-size: 1.65rem;
    color: #047857;
}

.done-message {
    margin: 0 0 1.5rem;
    color: #334155;
    line-height: 1.7;
    font-size: 1rem;
}

.done-summary {
    text-align: left;
    background: #f8fbff;
    border: 1px solid #e0ecff;
    border-radius: 18px;
    padding: 1rem 1.15rem;
    display: grid;
    gap: 0.6rem;
    max-width: 420px;
    margin: 0 auto;
}

.done-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    font-size: 0.95rem;
}

.done-summary-row span { color: #6b7280; }
.done-summary-row strong { color: #0f172a; font-weight: 600; }

@media (max-width: 940px) {
    .booking-main { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .booking-header,
    .booking-card,
    .booking-calendar,
    .booking-form {
        border-radius: 20px;
        padding: 1.25rem;
    }
    .days-grid,
    .time-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
