/* ================================================== setup wizard (paper) */

.wizard {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 12px var(--h-pad) 32px;
  background: var(--paper);
  color: var(--ink);
  animation: fadeIn 0.2s ease;
}

.wTop {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  margin-top: 12px;
  flex: none;
}

.wBack {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease;
}

.wBack:hover {
  background: rgba(58, 58, 61, 0.06);
}

.wBack.is-hidden {
  visibility: hidden;
}

.wBack svg {
  width: 22px;
  height: 22px;
}

.wDots {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.2s ease;
}

/* step dots follow the logo petal palette, one color per step */
.dot.is-on:nth-child(1) { background: var(--p-orange); }
.dot.is-on:nth-child(2) { background: var(--p-coral); }
.dot.is-on:nth-child(3) { background: var(--p-yellow); }
.dot.is-on:nth-child(4) { background: var(--p-green); }
.dot.is-on:nth-child(5) { background: var(--p-teal); }
.dot.is-on:nth-child(6) { background: var(--p-blue); }
.dot.is-on:nth-child(7) { background: var(--p-purple); }

.wStep {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.wBody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0 16px;
  scrollbar-width: none;
}

.wBody::-webkit-scrollbar {
  display: none;
}

.wBody.is-enter {
  animation: bodyIn 0.24s cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes bodyIn {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

.wFoot {
  flex: none;
  padding-top: 16px;
}

.wPrimary {
  width: 100%;
  height: 64px;
  border: 0;
  border-radius: 14px;
  background: var(--brand-gradient);
  color: #fff;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(79, 169, 228, 0.35);
  transition: filter 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.wPrimary:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 14px 30px rgba(79, 169, 228, 0.42);
}

.wPrimary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wTitle {
  margin: 24px 0 0;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.wSub {
  margin: 12px 0 0;
  font-size: 20px;
  line-height: 1.5;
  color: var(--muted);
}

.wSectionTitle {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.wSectionHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
}

.wTextBtn {
  border: 0;
  background: transparent;
  padding: 12px;
  font-family: var(--font);
  font-size: 16px;
  color: var(--green);
  cursor: pointer;
}

.wCard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.wCard--selected {
  border: 2px solid var(--green);
}

.wSoftBtn {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--stage);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  cursor: pointer;
}

.wLinkBtn {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 16px;
  border: 0;
  background: transparent;
  color: var(--green);
  font-family: var(--font);
  font-size: 18px;
  cursor: pointer;
}

/* ------------------------------------------------------------------ S1 */

.hello {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 8px;
}

.hello__logo {
  width: min(380px, 66%);
  height: auto;
  display: block;
}

.hello__tagline {
  margin: 26px 0 0;
  width: min(380px, 66%);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0.15em;
  line-height: 1.45;
  text-align: center;
  color: var(--ink-soft);
}

.hello__version {
  margin-top: auto;
  padding-top: 24px;
  font-size: 13px;
  color: var(--muted);
  opacity: 0.8;
}

/* ------------------------------------------------------------------ S2 */

.langList {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 26px;
}

.langCard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  min-height: 92px;
  cursor: pointer;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  text-align: left;
  font-family: var(--font);
}

.langCard.is-selected {
  border: 2px solid var(--green);
  background: #f2fbf8;
}

.langCard__native {
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
}

.langCard__secondary {
  margin-top: 4px;
  font-size: 15px;
  color: var(--muted);
}

.langCard__text {
  flex: 1;
}

.checkIcon {
  width: 26px;
  height: 26px;
  color: var(--green);
  flex: none;
}

.checkIcon.is-hidden {
  visibility: hidden;
}

/* ------------------------------------------------------------------ S3 */

.connectedCard {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding: 20px 24px;
  min-height: 96px;
  border-radius: var(--radius-card);
  background: #effbf7;
  border: 2px solid var(--green);
}

.connectedCard__ssid {
  font-size: 22px;
  font-weight: 600;
  word-break: break-all;
}

.connectedCard__meta {
  margin-top: 3px;
  font-size: 15px;
  color: var(--muted);
}

.netList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.netRow {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px 24px;
  min-height: 88px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  font-family: var(--font);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.netRow:hover {
  border-color: var(--line-strong);
}

.netRow:active {
  transform: scale(0.99);
}

.netRow__main {
  flex: 1;
  min-width: 0;
}

.netRow__ssid {
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.netRow__meta {
  margin-top: 3px;
  font-size: 14px;
  color: var(--muted);
}

.netRow__lock {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex: none;
}

.statusRow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  min-height: 30px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.statusRow .spinner {
  width: 20px;
  height: 20px;
}

.permCard {
  margin-top: 24px;
  padding: 24px;
}

.permCard h4 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.permCard p {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.permCard .wSoftBtn {
  margin-top: 16px;
}

/* ------------------------------------------------------------------ S4 */

.nameGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 26px;
}

.nameCard {
  min-height: 104px;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--card);
  font-family: var(--font);
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
}

.nameCard.is-selected {
  border: 2px solid var(--green);
  background: #f2fbf8;
}

.customNameField {
  width: 100%;
  margin-top: 16px;
  min-height: 88px;
  padding: 24px;
  font-family: var(--font);
  font-size: 20px;
  color: var(--ink);
  border: 2px solid var(--green);
  border-radius: var(--radius-card);
  background: var(--card);
  outline: none;
}

.customNameField::placeholder {
  color: var(--muted);
}

/* ------------------------------------------------------------------ S5 */

.pairWrap {
  text-align: center;
}

.qrCard {
  width: 260px;
  height: 260px;
  margin: 24px auto 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  display: grid;
  place-items: center;
}

.qrCard canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.pairCode {
  margin: 20px 0 0;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-indent: 0.15em;
  font-variant-numeric: tabular-nums;
}

.pairHint {
  margin: 10px auto 0;
  max-width: 520px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
}

.pairStatus {
  justify-content: center;
  font-size: 17px;
  color: var(--ink-soft);
}

.errorBanner {
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  background: var(--coral-soft);
  color: #c22a46;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}

.pairNewCode {
  margin-top: 22px;
}

/* ------------------------------------------------------------------ S6 */

.brightnessCard {
  margin-top: 24px;
  padding: 24px;
}

.brightnessHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brightnessHead span:first-child {
  font-size: 22px;
  font-weight: 600;
}

.brightnessValue {
  font-size: 22px;
  font-weight: 600;
  color: var(--green);
}

.slider {
  width: 100%;
  margin-top: 18px;
  height: 28px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: var(--line-strong);
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--green);
  border: 4px solid #fff;
  box-shadow: 0 2px 8px rgba(18, 191, 163, 0.4);
}

.slider::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: var(--line-strong);
}

.slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  border: 4px solid #fff;
}

.sleepList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.sleepRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  padding: 0 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  cursor: pointer;
  font-family: var(--font);
  font-size: 19px;
  color: var(--ink);
  text-align: left;
}

.sleepRow.is-selected {
  border: 2px solid var(--green);
  background: #f2fbf8;
}

.customSleep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.customSleep label {
  font-size: 16px;
  color: var(--muted);
}

.timeField {
  width: 104px;
  padding: 14px;
  font-family: var(--font);
  font-size: 18px;
  text-align: center;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
}

.timeField:focus {
  border-color: var(--green);
}

.inlineError {
  margin-top: 8px;
  font-size: 14px;
  color: var(--coral);
}

/* ------------------------------------------------------------------ S7 */

.doneWrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 12px;
}

.doneBadge {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--brand-ring);
  display: grid;
  place-items: center;
  box-shadow: 0 18px 40px rgba(79, 169, 228, 0.35);
  animation: badgePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.doneBadge svg {
  width: 72px;
  height: 72px;
  color: #fff;
}

@keyframes badgePop {
  0% { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}

.doneTitle {
  margin: 32px 0 0;
  font-size: 34px;
  font-weight: 600;
}

.doneSubtitle {
  margin: 14px auto 0;
  max-width: 560px;
  font-size: 19px;
  line-height: 1.65;
  color: var(--muted);
}

/* -------------------------------------------------------------- unpaired */

.unpaired {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 var(--h-pad);
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  animation: fadeIn 0.2s ease;
}

.unpaired__mark {
  width: 132px;
  height: 132px;
  display: block;
}

.unpaired__title {
  margin: 28px 0 0;
  font-size: 30px;
  font-weight: 600;
}

.unpaired__sub {
  margin: 12px auto 0;
  max-width: 560px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--muted);
}

.unpaired__wifi {
  margin-top: 20px;
  font-size: 16px;
  color: var(--ink-soft);
}

.unpaired__btn {
  width: 100%;
  max-width: 680px;
  height: 64px;
  margin-top: 32px;
  border: 0;
  border-radius: 14px;
  background: var(--brand-gradient);
  color: #fff;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(79, 169, 228, 0.35);
  transition: filter 0.15s ease;
}

.unpaired__btn:hover {
  filter: brightness(1.06);
}

/* ------------------------------------------------------ small device preset */

.device--small .wTitle { font-size: 27px; }
.device--small .wSub { font-size: 16px; }
.device--small .wPrimary { font-size: 18px; height: 56px; }
.device--small .wizard { padding-left: 24px; padding-right: 24px; padding-bottom: 24px; }
.device--small .nameGrid { gap: 8px; }
.device--small .nameCard { min-height: 84px; font-size: 17px; }
.device--small .netRow { padding: 14px 16px; min-height: 72px; }
.device--small .netRow__ssid { font-size: 17px; }
.device--small .sleepRow { min-height: 68px; font-size: 16px; padding: 0 16px; }
.device--small .qrCard { width: 200px; height: 200px; }
.device--small .pairCode { font-size: 26px; }
.device--small .hello__logo { width: min(280px, 70%); }
.device--small .hello__tagline { width: min(280px, 70%); font-size: 21px; letter-spacing: 0.1em; }
.device--small .brightnessCard { padding: 18px; }
.device--small .unpaired__title { font-size: 24px; }
.device--small .unpaired__sub { font-size: 16px; }
