.phone-dialog {
  --phone-ink: #102348;
  --phone-blue: #e2f1fc;
  --phone-gold: #ffb719;
  box-sizing: border-box;
  width: min(960px, calc(100% - 48px));
  max-height: calc(100dvh - 48px);
  padding: 0 0 clamp(16px, 4vw, 48px);
  border: 1px solid #c4d8e8;
  border-radius: 22px;
  background: radial-gradient(ellipse at right top, #f5fbff, var(--phone-blue));
  color: var(--phone-ink);
}
.phone-dialog::backdrop { background: #0c1e3b99; }
.phone-dialog [hidden] { display: none !important; }
.phone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(14px, 3vw, 30px);
  background: #102348;
  color: #fff;
}
.phone-brand { font-size: clamp(15px, 3.6vw, 23px); font-weight: 800; }
.phone-brand-mark { width: 1.75em; height: 1em; margin-inline-end: .2em; vertical-align: middle; }
.phone-card {
  box-sizing: border-box;
  width: min(600px, calc(100% - 32px));
  margin: clamp(16px, 4vw, 48px) auto 0;
  padding: clamp(16px, 4vw, 36px);
  border: 1px solid #d3deeb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px #122d5210;
  overflow-wrap: anywhere;
}
.phone-card h2 { margin: 14px 0 8px; font-size: clamp(21px, 4.9vw, 31px); line-height: 1.25; }
.phone-card p { margin: .75em 0; line-height: 1.6; color: #334d71; }
.phone-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .2rem .7rem;
  margin: clamp(16px, 4vw, 32px) auto 0;
  padding: 0 14px;
  text-align: center;
  color: #334d71;
}
.phone-steps + .phone-card { margin-top: 1.15rem; }
.phone-steps strong { color: #102348; }
[dir=rtl] .phone-step-arrow { transform: scaleX(-1); }
.phone-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .4rem .8rem;
  margin-top: 1.3rem;
  padding-top: .85rem;
  border-top: 1px solid #d3deeb;
  font-size: .86rem;
}
.phone-legal-links :is(a,button) { color: #20558e; text-decoration: underline; }
.phone-linked-note {
  margin-block: 1rem;
  padding: .65rem 1rem;
  border: 1px solid #b9d8f7;
  border-radius: 12px;
  background: #edf7ff;
}
.phone-symbol {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 14px;
  background: var(--phone-blue);
  color: #185a9b;
  font-size: 26px;
  font-weight: 750;
}
.phone-dialog[data-state="verified"] .phone-symbol { background: #e1f6ed; color: #09704b; }
.phone-card .phone-note, .phone-mask {
  padding: 10px 14px;
  border-radius: 10px;
  background: #ecf6ff;
  color: var(--phone-ink);
}
.phone-mask { display: inline-block; font-variant-numeric: tabular-nums; }
.phone-privacy { font-size: .91em; }
.phone-card label { display: block; margin: 14px 0 6px; font-weight: 650; }
.phone-dialog input, .phone-dialog select {
  box-sizing: border-box;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid #a9bbd0;
  border-radius: 9px;
  background: #fff;
  color: var(--phone-ink);
  font: inherit;
}
#phoneCountry, #phoneNumber { width: 100%; min-width: 0; }
.phone-actions { display: grid; gap: 9px; margin-top: 18px; }
.phone-dialog button, .phone-secondary {
  border: 1px solid #a9bbd0;
  border-radius: 10px;
  padding: 9px 13px;
  min-height: 44px;
  color: var(--phone-ink);
  background: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  white-space: normal;
}
.phone-secondary { text-decoration: none; text-align: center; display: grid; place-items: center; }
.phone-dialog .phone-primary { background: var(--phone-gold); border-color: var(--phone-gold); }
.phone-dialog .phone-link { background: transparent; border: 0; padding-inline: 0; color: #1859a2; }
.phone-dialog button:disabled { cursor: default; color: #405571; background: #edf2f7; border-color: transparent; }
.phone-dialog :focus-visible { outline: 3px solid #2579d0; outline-offset: 3px; }
.phone-code-fields { position: relative; margin-top: 12px; }
#phoneCodeCells { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: clamp(4px, 1vw, 10px); }
#phoneCodeCells span {
  display: grid;
  place-items: center;
  min-height: 49px;
  border: 1px solid #a9bbd0;
  border-radius: 9px;
  font-size: clamp(18px, 4vw, 26px);
  font-weight: 650;
}
#phoneCode {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: text;
}
.phone-code-fields:focus-within #phoneCodeCells .phone-digit-active { outline: 3px solid #2579d0; outline-offset: 1px; }
.phone-code-fields:has(input[aria-invalid="true"]) #phoneCodeCells span { border-color: #b53236; background: #fff3f3; }
.phone-card .phone-message { padding: 9px 12px; background: #eef5fb; border-radius: 9px; }
.phone-card .phone-message[data-tone="error"] { background: #fff3f3; color: #9f2228; }
.phone-card .phone-message[data-tone="warning"] { background: #fff6dc; color: #795000; }
.phone-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 620px) {
  .phone-dialog { width: calc(100% - 18px); max-height: calc(100dvh - 18px); border-radius: 17px; }
  .phone-card { width: calc(100% - 20px); margin-top: 12px; }
}
@media (max-width: 1000px) and (max-height: 540px) and (orientation: landscape) {
  .phone-dialog { max-height: calc(100dvh - 16px); }
  .phone-header { position: sticky; top: 0; z-index: 1; }
}

/* Entry points on the teaching dashboard and in the account menu. */
#phoneVerificationHeader, #phoneVerificationReminder, #phoneVerificationDot,
#phoneVerificationMenu[hidden], #phoneVerificationMenuMask[hidden] {
  display: none;
}
body.lesson-practice :is(#phoneVerificationHeader, #phoneVerificationReminder) {
  display: none !important;
}
#teacherMenuToggle { position: relative; }
.signed-in-dashboard #phoneVerificationDot:not([hidden]) {
  position: absolute;
  display: block;
  inset-block-start: -4px;
  inset-inline-end: -4px;
  width: 13px;
  height: 13px;
  border: 2px solid #102348;
  border-radius: 50%;
  background: #ff5a56;
  pointer-events: none;
}
.phone-status-icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.signed-in-dashboard #teacherMenuPanel #phoneVerificationMenu:not([hidden]) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .5rem;
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  margin-block: 5px 8px;
  padding: 8px 10px;
  border: 1px solid #d5e2ef;
  border-radius: 10px;
  background: #f1f6fb;
  color: #203e60;
  font-size: 1rem;
  line-height: 1.25;
}
#phoneVerificationMenu strong { font-weight: 750; }
#phoneVerificationMenu bdi {
  font-size: .86rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#phoneVerificationMenu .phone-status-check,
#phoneVerificationMenu[data-verification="verified"] .phone-status-icon:not(.phone-status-check) {
  display: none;
}
#phoneVerificationMenu[data-verification="verified"] .phone-status-check { display: block; }
.phone-status-check circle { fill: #0c7954; stroke: none; }
.phone-status-check path { stroke: white; stroke-width: 2; }
.signed-in-dashboard #teacherMenuPanel #phoneVerificationMenu[data-verification="unverified"]:not([hidden]) {
  --phone-shield-bg: #fff0ed;
  border-color: #efb3aa;
  background: #fff0ed;
  color: #922c20;
}
.signed-in-dashboard #teacherMenuPanel #phoneVerificationMenu[data-verification="verified"]:not([hidden]) {
  border-color: #a5d9c3;
  background: #e8f8ef;
  color: #125b43;
}
.signed-in-dashboard #teacherMenuPanel #phoneVerificationMenu:hover {
  box-shadow: inset 0 0 0 1px currentColor;
}

.signed-in-dashboard #phoneVerificationReminder:not([hidden]) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem .7rem;
  margin-block-end: 12px;
  padding: 10px clamp(9px, 2vw, 16px);
  border: 1px solid #efb3aa;
  border-inline-start: 4px solid #c4442b;
  border-radius: 13px;
  background: #fff3ee;
  color: #8e2d22;
  --phone-shield-bg: #fff3ee;
}
#phoneVerificationReminder h2 {
  margin: 0;
  color: #102348;
  font-size: 1.02rem;
  line-height: 1.25;
}
#phoneVerificationReminder p {
  margin: .18em 0 0;
  font-size: .89rem;
  line-height: 1.35;
}
.signed-in-dashboard .top-navbar #phoneVerificationHeader.phone-status-action,
#phoneVerificationReminderAction.phone-status-action {
  --phone-shield-bg: #af371e;
  justify-content: center;
  min-height: 44px;
  padding: .45rem .65rem;
  border: 1px solid #a3331e;
  border-radius: 10px;
  background: #af371e;
  color: #fff;
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}
.signed-in-dashboard .top-navbar #phoneVerificationHeader:hover,
#phoneVerificationReminderAction:hover {
  --phone-shield-bg: #8f2a17;
  background: #8f2a17;
}
#phoneVerificationReminderAction:focus-visible { outline: 3px solid #1859a2; outline-offset: 2px; }

@media (max-width: 360px) {
  .signed-in-dashboard #phoneVerificationReminder:not([hidden]) { grid-template-columns: auto minmax(0, 1fr); }
  #phoneVerificationReminderAction { grid-column: 2; justify-self: start; }
}
@media (min-width: 1280px) {
  .signed-in-dashboard .top-navbar #phoneVerificationHeader:not([hidden]) { display: inline-flex; gap: .42rem; }
  .signed-in-dashboard #phoneVerificationReminder:not([hidden]) { display: none; }
}
