/* register.css — only what's unique to the register page. Everything
   shared with the other accounts pages (card chrome, form, toasts, alert
   modal, password toggle) lives in auth_shared.css, loaded just before
   this file. */

/* Register's form is taller than login's (6 fields vs. 2) -- top-aligning
   it instead of auth_shared.css's centered default keeps it from starting
   above the viewport on shorter screens. */
.login-page-wrap {
  flex:1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 20px 40px;
  background: var(--panel);
}

.role-toggle {
  position: relative;
  display: flex;
  background: var(--panel);
  border-radius:var(--radius-pill);
  padding: 4px;
  margin: 16px 0 22px;
  width: 100%;
}

.role-toggle-option {
  position: relative;
  flex: 1;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  opacity: 0.45;
  cursor: pointer;
  border-radius:var(--radius-pill);
  transition: color 0.25s ease, opacity 0.25s ease;
  user-select: none;
}

.role-toggle-option span {
  display: block;
  width: 100%;
  text-align: center;
  line-height: 1;
  pointer-events: none;
}

.role-toggle-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.role-toggle-option.is-active {
  color: var(--ink);
  opacity: 1;
}

.role-toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: var(--paper);
  border-radius:var(--radius-pill);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
  pointer-events: none;
}

/* Teacher is the first (left) option, Student is the second (right) option.
   The thumb starts on the left by default (under Teacher), and should only
   move right when STUDENT is the one actually checked. */
.role-toggle:has(input[value="STUDENT"]:checked) .role-toggle-thumb {
  left: auto;
  right: 4px;
}
.field-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.field-label-row label {
  margin-bottom: 0;
}

.field-tooltip {
  position: relative;
  display: inline-flex;
}

.field-tooltip-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.field-tooltip-icon svg { width: 10px; height: 10px; }

.field-tooltip-icon:hover,
.field-tooltip-icon:focus {
  background: var(--blue);
  color: #ffffff;
  outline: none;
}

.field-tooltip-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  /* Anchored from the icon's right edge, extending leftward, instead of
     from its left edge extending rightward — the icon sits after the
     field label (left-ish/middle of the row), so extending left keeps
     the popup within the viewport on narrow screens instead of running
     off the right edge while invisible (which used to force the whole
     page horizontally scrollable). */
  right: 0;
  width: 240px;
  max-width: calc(100vw - 32px);
  background: var(--panel);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius:var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 20;
  text-align: left;
}

.field-tooltip-popup ul {
  margin: 0;
  padding-left: 16px;
}

.field-tooltip-popup li {
  margin-bottom: 4px;
}

.field-tooltip-popup li:last-child {
  margin-bottom: 0;
}

.field-tooltip-popup::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 14px;
  border: 6px solid transparent;
  border-top-color: var(--panel);
}

.field-tooltip-icon:hover ~ .field-tooltip-popup,
.field-tooltip-icon:focus ~ .field-tooltip-popup,
.field-tooltip:focus-within .field-tooltip-popup {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
