/* ==========================================================================
   Geny sales assistant

   Colours are the SSBM tokens from Content/ssbm-ui.css, not the stray
   Microsoft blue (#0078d4) this page used to carry. Type is a Helvetica-
   lineage system stack - apt for a Swiss school and free of a third-party
   font request on a lead-capture page.

   The previous stylesheet defined .chatbot, .chatbot-wrapper and
   .chatbot-container - card, shadow, max-width, radius - and then never
   applied any of them, because the markup used id="chatbot" with no class
   and no wrapper. Everything below is actually attached to something.
   ========================================================================== */

.geny {
    --ink:    #0f172a;
    --body:   #1f2937;  /* reading text - NOT --muted, which is for labels/meta only */
    --accent: #2563eb;
    --soft:   #60a5fa;
    --muted:  #64748b;
    --line:   rgba(15,23,42,.10);
    --wash:   #f8fbff;

    max-width: 940px;
    margin: 0 auto 40px auto;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

/* ---- step indicator ------------------------------------------------------
   Numbered because the funnel genuinely is a sequence, and because the page
   makes you postback through it - people deserve to know how far it runs. */
/* PSMGenyChat.aspx carries .geny-psm as well. Same layout, same type; set an
   accent here if PSM Paris ever wants its own colour, e.g.
   .geny.geny-psm { --accent: #<psm brand hex>; }
   Left unset deliberately rather than inventing a brand colour. */

.geny-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 22px 0;
    font-size: 13px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    flex-wrap: wrap;
}
.geny-step { display: flex; align-items: center; gap: 7px; }
.geny-step-num {
    width: 22px; height: 22px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
    font-size: 11px; font-weight: 700; letter-spacing: 0;
    background: #fff;
}
.geny-step.is-current { color: var(--ink); font-weight: 700; }
.geny-step.is-current .geny-step-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.geny-step.is-done .geny-step-num { background: var(--ink); border-color: var(--ink); color: #fff; }
.geny-step-rule { flex: 1 1 18px; height: 1px; background: var(--line); min-width: 12px; }

/* ---- shared card --------------------------------------------------------- */
.geny-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15,23,42,.07);
    overflow: hidden;
}
.geny-pad { padding: 32px 36px; }
@media (max-width: 700px) { .geny-pad { padding: 22px 20px; } }

.geny-title {
    margin: 0 0 8px 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.015em;
    line-height: 1.22;
}
/* Reading text stays at or above the 16px it was before the redesign, in --body.
   --muted is reserved for labels, timestamps and hints - not for prose. */
.geny-lede  { margin: 0 0 20px 0; font-size: 17px; line-height: 1.6; color: var(--body); }
.geny-legal { font-size: 16px; line-height: 1.7; color: var(--body); }
.geny-legal p { margin: 0 0 14px 0; }

/* ---- consent ------------------------------------------------------------- */
.geny-consent { margin: 18px 0; }
.geny-consent label {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 15px; line-height: 1.6; font-weight: 400;
    color: var(--ink); margin: 0 0 12px 0; cursor: pointer;
    white-space: normal;             /* was nowrap - it forced horizontal scroll on phones */
}
.geny-consent input[type=checkbox] { margin: 3px 0 0 0; flex: 0 0 auto; }
.geny-consent a { color: var(--accent); text-decoration: underline; }

/* ---- buttons ------------------------------------------------------------- */
.geny-btn {
    display: inline-block; border: 0; border-radius: 10px;
    background: var(--accent); color: #fff;
    padding: 12px 24px; font-size: 16px; font-weight: 600;
    cursor: pointer; transition: background .15s ease, transform .15s ease;
}
.geny-btn:hover, .geny-btn:focus { background: #1d4ed8; color: #fff; text-decoration: none; }
.geny-btn:active { transform: translateY(1px); }
.geny-btn[disabled] { background: #94a3b8; cursor: not-allowed; }

/* Student/Get_Support_AI renders these as <asp:Button>, i.e. input[type=submit],
   which Safari re-skins with its own chrome and drops the radius. */
.geny-btn, .geny-send { -webkit-appearance: none; appearance: none; font-family: inherit; }

/* Back-link row above the card. */
.geny-topbar { margin: 0 0 18px 0; }

/* ---- lead form -----------------------------------------------------------
   The mascot used to be a full-width centred block dropped below the field
   grid, so it floated in the dead space left by the half-empty last row.
   It is now a sidebar that fills that space on purpose. */
.geny-step2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 8px 32px;
    align-items: center;
}
.geny-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }

@media (max-width: 820px) {
    /* Below this the two field columns plus a sidebar get too cramped. */
    .geny-step2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) { .geny-fields { grid-template-columns: 1fr; } }
.geny-field label {
    display: block; font-size: 13px; font-weight: 600;
    letter-spacing: .03em; text-transform: uppercase;
    color: #475569; margin-bottom: 6px;
}
/* Widths were hard-coded at 300/250/350px, which overflowed narrow screens. */
.geny-field .form-control { width: 100%; height: 46px; border-radius: 10px; font-size: 16px; color: var(--ink); }
.geny-field textarea.form-control { height: auto; }
.geny-req { color: #dc2626; font-weight: 700; margin-left: 4px; }

.geny-mascot { text-align: center; margin: 0; }
.geny-mascot img { max-width: 190px; width: 100%; height: auto; display: block; margin: 0 auto; }
.geny-mascot figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.4; }

@media (max-width: 820px) {
    /* Stacked: keep it as a small signature rather than a full-width portrait. */
    .geny-mascot { margin-top: 18px; }
    .geny-mascot img { max-width: 130px; }
}

/* ---- chat ---------------------------------------------------------------- */
.geny-chat { display: flex; flex-direction: column; height: 640px; }
@media (max-width: 700px) { .geny-chat { height: calc(100vh - 200px); min-height: 380px; } }

.geny-chat-head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px;
    background: var(--ink);
    color: #fff;
    flex: 0 0 auto;
}
.geny-chat-head img { width: 36px; height: 36px; border-radius: 50%; background: #fff; object-fit: cover; }
.geny-chat-head h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.005em; }
.geny-chat-head .geny-status { font-size: 13px; color: rgba(255,255,255,.66); display: flex; align-items: center; gap: 6px; }
.geny-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; display: inline-block; }

.geny-log {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 22px 24px;
    background: var(--wash);
    display: flex; flex-direction: column; gap: 14px;
}

.geny-msg { display: flex; gap: 10px; max-width: 76%; }
.geny-msg-bubble {
    padding: 12px 15px; border-radius: 14px;
    font-size: 16px; line-height: 1.6;
    animation: geny-rise .18s ease-out;
}
.geny-msg-bubble p { margin: 0 0 8px 0; }
.geny-msg-bubble p:last-child { margin-bottom: 0; }
.geny-msg-bubble a { color: inherit; text-decoration: underline; }

.geny-msg.bot { align-self: flex-start; }
.geny-msg.bot .geny-msg-bubble {
    background: #fff; border: 1px solid var(--line);
    border-bottom-left-radius: 4px; color: var(--ink);
}
.geny-msg.bot img.geny-avatar { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; }

.geny-msg.me { align-self: flex-end; }
.geny-msg.me .geny-msg-bubble {
    background: var(--accent); color: #fff;
    border-bottom-right-radius: 4px;
}
.geny-msg.me .geny-msg-bubble a { color: #fff; }

.geny-time { font-size: 11px; color: var(--muted); margin-top: 5px; }

/* Empty state, for surfaces with no server-rendered greeting. margin:auto
   centres it in the flex column so the log is never a blank rectangle. */
.geny-empty { margin: auto; text-align: center; color: var(--muted); padding: 10px; }
.geny-empty img { width: 96px; height: auto; display: block; margin: 0 auto 12px auto; }
.geny-empty p { margin: 0; font-size: 14px; line-height: 1.5; }

/* Rating: the only way answer quality has ever been measurable. */
.geny-rate { display: flex; gap: 6px; margin-top: 7px; }
.geny-rate button {
    border: 1px solid var(--line); background: #fff; border-radius: 7px;
    padding: 2px 8px; font-size: 12px; color: var(--muted); cursor: pointer;
    transition: all .15s ease;
}
.geny-rate button:hover { border-color: var(--accent); color: var(--accent); }
.geny-rate button[disabled] { opacity: .55; cursor: default; border-color: var(--line); }
.geny-rate .geny-rated { color: #16a34a; font-size: 12px; align-self: center; }

/* Typing indicator, inline in the log - replaces the full-screen dark overlay
   and fixed spinner that used to freeze the entire page for the whole request. */
.geny-typing { display: flex; gap: 4px; align-items: center; padding: 4px 2px; }
.geny-typing span {
    width: 7px; height: 7px; border-radius: 50%; background: var(--soft);
    animation: geny-blink 1.2s infinite ease-in-out;
}
.geny-typing span:nth-child(2) { animation-delay: .18s; }
.geny-typing span:nth-child(3) { animation-delay: .36s; }

/* ---- suggested questions -------------------------------------------------
   Seeded server-side from the questions prospects actually ask most, so the
   blank input is never the first thing a visitor faces. */
.geny-chips { padding: 0 24px 4px 24px; background: var(--wash); flex: 0 0 auto; }
.geny-chips-label {
    font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 8px;
}
.geny-chip-row { display: flex; flex-wrap: wrap; gap: 7px; padding-bottom: 12px; }
.geny-chip {
    border: 1px solid rgba(37,99,235,.28); background: #fff; color: var(--accent);
    border-radius: 999px; padding: 7px 14px; font-size: 14px; line-height: 1.35;
    cursor: pointer; text-align: left; transition: background .15s ease, border-color .15s ease;
}
.geny-chip:hover { background: rgba(37,99,235,.07); border-color: var(--accent); }

/* ---- composer ------------------------------------------------------------ */
.geny-composer {
    display: flex; gap: 10px; align-items: center;
    padding: 14px 20px;
    background: #fff; border-top: 1px solid var(--line);
    flex: 0 0 auto;
}
.geny-composer input[type=text] {
    flex: 1 1 auto; min-width: 0;
    border: 1px solid var(--line); border-radius: 999px;
    padding: 11px 16px;
    font-size: 16px;          /* 16px stops iOS zooming the page on focus */
    font-family: inherit; color: var(--ink); background: var(--wash);
}
.geny-composer input[type=text]:focus { outline: 2px solid rgba(37,99,235,.35); outline-offset: 1px; background: #fff; }
.geny-composer input[type=text][disabled] { opacity: .6; }
.geny-send {
    flex: 0 0 auto; border: 0; border-radius: 999px;
    background: var(--accent); color: #fff;
    padding: 12px 22px; font-size: 16px; font-weight: 600; cursor: pointer;
}
.geny-send:hover { background: #1d4ed8; }
.geny-send[disabled] { background: #94a3b8; cursor: not-allowed; }

.geny-foot { font-size: 13px; color: var(--muted); padding: 12px 4px 0 4px; text-align: center; }

.geny-error {
    background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
    padding: 12px 15px; border-radius: 10px; font-size: 15px; margin-bottom: 16px;
}

/* ---- accessibility floor ------------------------------------------------- */
.geny :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.geny-sr {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@keyframes geny-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes geny-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .geny-msg-bubble { animation: none; }
    .geny-typing span { animation: none; opacity: .6; }
    .geny-btn, .geny-chip, .geny-send { transition: none; }
}
