html, body {
    min-height: 100%;
    margin: 0;
    font-family: Inter, Helvetica, Arial, sans-serif;
    background: #f4f7fb;
    color: #121212;
}

* { 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;
}

.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; }

.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.5rem; }

.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.4rem;
    color: #0f172a;
}

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

.verify-summary {
    text-align: left;
    background: #f8fbff;
    border: 1px solid #e0ecff;
    border-radius: 18px;
    padding: 1rem 1.15rem;
    margin: 1.25rem 0 1.5rem;
    display: grid;
    gap: 0.6rem;
}

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

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

.google-signin-button {
    width: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid #dadce0;
    border-radius: 14px;
    background: white;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    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, transform 0.18s ease;
    position: relative;
    overflow: hidden; /* clip the mana fill at button edges */
    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 6px 14px rgba(60, 64, 67, 0.12);
    background: #f8faff;
    border-color: #c6d4ff;
}

.google-signin-button:active:not(:disabled) {
    background: #eff4ff;
}

.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: 25px; height: 25px; }

.verify-note {
    margin: 1rem 0 0;
    color: #6b7280;
    font-size: 0.86rem;
    line-height: 1.55;
}

/* ───── 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));
    }
}
