/*!
 * X Tables / Times Table Treasure
 * Shared site styles
 *
 * Copyright (c) 2026 ZypherLock LLC. All rights reserved.
 * This file is part of the X Tables educational platform and may not be
 * copied, modified, distributed or reused without written permission.
 */

/* Keep centred public layouts from shifting between short and long pages. */
html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

:root {
  --xt-shell-width: 1180px;
  --xt-page-gutter: 28px;
  --xt-header-width: 1480px;
}

/* Form labels used on public, parent and beta forms. */
label.form-label {
  display: block;
  margin: 10px 0 6px;
  font-weight: 900;
  color: #fff4c8;
}

/* Standard text fields, dropdowns and textarea controls. */
input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  padding: 11px 12px;
  color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.08));
  font: 15px/1.45 Arial, Helvetica, sans-serif;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 18px rgba(0,0,0,.10);
}

/* Dropdowns keep native behaviour while matching the site surface. */
select {
  min-height: 46px;
  padding-right: 42px;
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #ffe58f 50%) right 20px center / 7px 7px no-repeat,
    linear-gradient(135deg, #ffe58f 50%, transparent 50%) right 15px center / 7px 7px no-repeat,
    linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.08));
  cursor: pointer;
}

select option {
  color: #071523;
  background: #f8fbff;
}

select::-ms-expand {
  display: none;
}

input::placeholder,
textarea::placeholder {
  color: #aac0d3;
}

/* Two-column form layouts collapse to one column on small screens. */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Toggle-style checkbox groups used for device/browser selections. */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 7px;
}

.choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

/* Hide the native checkbox while retaining label click behaviour. */
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-switch {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(180deg, #0072B2, #00598C);
  border: 2px solid rgba(255,255,255,.24);
  box-shadow: inset 0 2px 7px rgba(0,0,0,.34), 0 6px 14px rgba(0,114,178,.22);
}

.choice-switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,.28);
  transition: transform .18s ease;
}

.choice input:checked + .choice-switch {
  background: linear-gradient(180deg, #FFE135, #F2A900);
  border-color: rgba(255,225,53,.68);
}

.choice input:checked + .choice-switch::after {
  transform: translateX(24px);
}

.choice:focus-within,
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(255,229,143,.72);
  outline-offset: 2px;
}

/* Repeated family rows for parent/child beta account details. */
.family-row {
  padding: 10px;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  background: rgba(255,255,255,.07);
}

.family-row h3 {
  font-size: 15px;
  margin-bottom: 6px;
  color: #fff4c8;
}

/* Compact stacked form layout for application flows. */
.apply-form {
  display: grid;
  gap: 10px;
}

/* Shared compact form rhythm for public contact and policy support forms. */
.xt-form {
  display: grid;
  gap: 10px;
}

.xt-form label {
  display: block;
  margin: 0 0 5px;
  color: #fff4c8;
  font-weight: 900;
}

.xt-form input,
.xt-form select,
.xt-form textarea {
  margin: 0;
}

.xt-form textarea {
  min-height: 150px;
  resize: vertical;
}

/* Shared Mr Know corner guide used on public pages. */
.mrknow-widget {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  pointer-events: none;
}

.mrknow-widget.is-right {
  left: auto;
  right: 8px;
  flex-direction: row-reverse;
}

.mrknow-link {
  display: block;
  text-decoration: none;
  line-height: 0;
  pointer-events: auto;
}

.mrknow-image {
  display: block;
  width: auto;
  height: auto;
  transform-origin: top left;
  transition: transform .24s ease, filter .24s ease, opacity .24s ease;
  filter: drop-shadow(0 14px 24px rgba(0,0,0,.28));
}

.mrknow-widget.is-right .mrknow-image {
  transform-origin: top right;
}

.mrknow-widget.is-large .mrknow-image {
  height: 220px;
  max-width: min(46vw, 420px);
}

.mrknow-widget.is-large .mrknow-link {
  width: 220px;
  height: 220px;
}

.mrknow-widget.is-small .mrknow-image {
  height: 78px;
  max-width: none;
}

.mrknow-widget.is-small .mrknow-link {
  width: 78px;
  height: 78px;
}

.mrknow-widget.is-small.is-hovered .mrknow-image,
.mrknow-widget.is-small .mrknow-link:hover .mrknow-image {
  transform: scale(3.1);
  filter: drop-shadow(0 20px 34px rgba(0,0,0,.36));
}

.mrknow-widget.is-large.is-hovered .mrknow-image,
.mrknow-widget.is-large .mrknow-link:hover .mrknow-image {
  transform: scale(1.08);
}

.mrknow-bubble {
  position: absolute;
  top: 98px;
  left: 116px;
  margin: 0;
  min-width: 220px;
  max-width: 280px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(8,21,34,.92);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  box-shadow: 0 16px 38px rgba(0,0,0,.32);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.mrknow-widget.is-right .mrknow-bubble {
  left: auto;
  right: 116px;
  text-align: right;
}

.mrknow-question-link {
  color: #ffffff;
  text-decoration: none;
  display: inline-block;
  pointer-events: auto;
}

.mrknow-question-link:hover {
  text-decoration: underline;
}

.mrknow-widget.is-hovered .mrknow-bubble,
.mrknow-widget:has(.mrknow-link:hover) .mrknow-bubble,
.mrknow-widget:focus-within .mrknow-bubble {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Public guide page layout used by How To Play. */
.xt-public-page {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(5,10,18,.24), rgba(5,10,18,.76)),
    url('/timetable/assets/images/stages/pirate_cove/m01_bg.webp') center/cover fixed no-repeat,
    #081522;
  overflow-x: hidden;
}

.xt-public-page > .page,
.xt-public-page > .mk-page,
.xt-public-page > .school-page,
.xt-public-page > main.page {
  flex: 1 0 auto;
}

.xt-public-page .mk-page,
.xt-public-page .school-page,
.xt-public-page > .page {
  display: flex;
  flex-direction: column;
}

.xt-public-page .xt-site-footer {
  margin-top: auto;
}

.xt-guide {
  position: relative;
  z-index: 1;
  width: min(var(--xt-shell-width), calc(100vw - var(--xt-page-gutter)));
  margin: 0 auto;
  padding: 6px 0 72px;
}

.xt-public-page .page.xt-guide {
  width: min(var(--xt-shell-width), calc(100vw - var(--xt-page-gutter)));
  margin: 0 auto 32px;
  padding: 0 0 72px;
}

.xt-page-header {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(var(--xt-header-width), calc(100vw - 32px));
  margin: 0 auto 8px;
  padding: 8px 0 6px 96px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.xt-public-page .xt-page-header {
  margin: 0 auto 8px;
}

.xt-account-page .xt-page-header,
.xt-school-page .xt-page-header,
.xt-beta-page .xt-page-header {
  width: min(var(--xt-header-width), calc(100vw - 32px));
  margin: 0 auto 8px;
  padding: 8px 0 6px 96px;
}

.xt-page-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  font-weight: 900;
  min-height: 34px;
  padding: 5px 0;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
  text-shadow: 0 3px 14px rgba(0,0,0,.35);
}

.xt-page-brand img {
  width: 0;
  height: auto;
  display: none;
}

.xt-page-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
  padding: 0;
}

.xt-page-nav .xt-button {
  min-height: 32px;
  padding: 6px 13px;
  white-space: nowrap;
  font-size: 15px;
}

.xt-guide-hero,
.xt-panel,
.xt-guide-card,
.xt-tip,
.xt-step {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(8,21,34,.64);
  box-shadow: 0 20px 60px rgba(0,0,0,.26);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.xt-guide-hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
  align-items: stretch;
  padding: 26px;
  border-radius: 28px;
}

.xt-kicker,
.xt-badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(115,215,255,.18);
  background: rgba(115,215,255,.13);
  color: #dff7ff;
  font-size: 13px;
  font-weight: 900;
}

.xt-guide h1 {
  margin: 0 0 14px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: .92;
  text-shadow: 0 8px 28px rgba(0,0,0,.32);
}

.xt-guide h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.xt-guide h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.xt-guide p {
  margin: 0;
  color: #d9edf8;
  line-height: 1.55;
  font-size: 17px;
}

.xt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.xt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 15px;
  line-height: 1;
  border-radius: 22px;
  border: 2px solid rgba(255,255,255,.18);
  background: linear-gradient(180deg,#0072B2,#00598C);
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(0,114,178,.26), 0 9px 18px rgba(0,0,0,.16);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.xt-button:hover,
.xt-button:focus {
  transform: translateY(-2px);
  background: linear-gradient(180deg,#D55E00,#A94900);
  border-color: rgba(255,255,255,.38);
  outline: 3px solid rgba(255,255,255,.28);
  outline-offset: 2px;
}

.xt-button.primary {
  color: #1b1300;
  border-color: rgba(255,225,53,.68);
  background: linear-gradient(180deg,#FFE135,#F2A900);
}

.xt-button.primary:hover,
.xt-button.primary:focus {
  background: linear-gradient(180deg,#D55E00,#A94900);
  border-color: rgba(255,255,255,.42);
}

.xt-guide-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
}

.xt-route-preview {
  position: relative;
  height: 160px;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 30%, rgba(115,215,255,.20), transparent 26%),
    radial-gradient(circle at 78% 38%, rgba(255,229,143,.18), transparent 24%),
    rgba(10,27,42,.66);
  border: 1px solid rgba(255,255,255,.12);
}

.xt-route-line,
.xt-route-fill {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 78px;
  height: 12px;
  border-radius: 999px;
}

.xt-route-line {
  background: rgba(255,255,255,.18);
}

.xt-route-fill {
  right: auto;
  width: 68%;
  background: linear-gradient(90deg, #7cecff, #ffe07a);
  box-shadow: 0 0 20px rgba(255,224,122,.24);
}

.xt-route-player,
.xt-route-goal {
  position: absolute;
  top: 62px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 900;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
}

.xt-route-player {
  left: 64%;
}

.xt-route-goal {
  right: 18px;
}

.xt-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.xt-panel {
  padding: 22px;
  border-radius: 24px;
}

.xt-wide {
  grid-column: 1 / -1;
}

.xt-step-list,
.xt-tip-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.xt-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 18px;
}

.xt-step-num {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,229,143,.24), rgba(246,195,62,.13));
  border: 1px solid rgba(255,229,143,.22);
  color: #fff2bf;
  font-weight: 900;
  font-size: 20px;
}

.xt-tip-grid {
  grid-template-columns: repeat(3, 1fr);
}

.xt-tip {
  padding: 16px;
  border-radius: 20px;
}

.xt-panel > .xt-tip + .xt-tip {
  margin-top: 12px;
}

.xt-step p,
.xt-tip p {
  font-size: 15px;
}

/* Legacy public content classes used by Privacy, Terms and Contact while they migrate to the shared shell. */
.xt-public-page .page {
  width: min(var(--xt-shell-width), calc(100vw - var(--xt-page-gutter)));
  margin: 0 auto 32px;
}

.xt-public-page .hero,
.xt-public-page .section,
.xt-public-page .panel,
.xt-public-page .choice {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(7,18,34,.72);
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 8px;
}

.xt-public-page .hero,
.xt-public-page .section,
.xt-public-page .panel {
  padding: 24px;
}

.xt-public-page .hero {
  margin-bottom: 16px;
}

.xt-public-page .eyebrow {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #ffe58f;
  font-weight: 900;
}

.xt-public-page h1 {
  margin: 16px 0 10px;
  font-size: clamp(38px,5vw,64px);
  line-height: .96;
}

.xt-public-page h2 {
  margin: 22px 0 8px;
  color: #fff4c8;
}

.xt-public-page h3 {
  margin: 14px 0 6px;
  color: #ffe58f;
}

.xt-public-page p,
.xt-public-page li {
  color: #dbeeff;
  line-height: 1.62;
}

.xt-public-page ul {
  margin: 10px 0 0 22px;
  padding: 0;
}

.xt-public-page .nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.xt-public-page .btn,
.xt-public-page button,
.xt-public-page .mk-button,
.xt-public-page .school-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 16px;
  border-radius: 22px;
  border: 2px solid rgba(255,255,255,.18);
  background: linear-gradient(180deg,#0072B2,#00598C);
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(0,114,178,.26), 0 9px 18px rgba(0,0,0,.16);
}

.xt-public-page .btn:hover,
.xt-public-page .btn:focus,
.xt-public-page button:hover,
.xt-public-page button:focus,
.xt-public-page .mk-button:hover,
.xt-public-page .mk-button:focus,
.xt-public-page .school-button:hover,
.xt-public-page .school-button:focus {
  background: linear-gradient(180deg,#D55E00,#A94900);
  border-color: rgba(255,255,255,.38);
}

.xt-public-page .btn.primary,
.xt-public-page button.primary,
.xt-public-page .mk-button.primary,
.xt-public-page .school-button.primary {
  color: #1b1300;
  border-color: rgba(255,225,53,.68);
  background: linear-gradient(180deg,#FFE135,#F2A900);
}

.xt-public-page .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.xt-public-page .choice {
  display: block;
  min-height: auto;
  margin: 0;
  padding: 16px;
  cursor: default;
  font-size: 16px;
  font-weight: 800;
}

.xt-public-page .choice strong {
  display: block;
  color: #ffe58f;
  margin-bottom: 6px;
}

.xt-public-page .content {
  display: grid;
  gap: 12px;
}

.xt-public-page .footer {
  display: none;
}

@media (max-width: 700px) {
  .mrknow-widget.is-large .mrknow-image {
    height: 140px;
    max-width: min(56vw, 260px);
  }

  .mrknow-widget.is-large .mrknow-link {
    width: 140px;
    height: 140px;
  }

  .mrknow-widget.is-small .mrknow-image {
    height: 68px;
  }

  .mrknow-widget.is-small .mrknow-link {
    width: 68px;
    height: 68px;
  }

  .mrknow-widget.is-small.is-hovered .mrknow-image,
  .mrknow-widget.is-small .mrknow-link:hover .mrknow-image {
    transform: scale(2.2);
  }

  .mrknow-bubble {
    top: 72px;
    left: 16px;
    font-size: 13px;
    padding: 10px 12px;
    max-width: 60vw;
    white-space: normal;
  }

  .mrknow-widget.is-right .mrknow-bubble {
    left: auto;
    right: 16px;
  }
}

/* Mobile form adjustments. */
@media (max-width: 860px) {
  .xt-page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0 6px 84px;
  }

  .xt-page-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
  }

  .xt-public-page .xt-page-header {
    padding-left: 84px;
  }

  .xt-guide-hero,
  .xt-guide-grid,
  .xt-tip-grid {
    grid-template-columns: 1fr;
  }

  .xt-guide-hero {
    padding: 20px;
  }
}

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