/* =========================
   Base
========================= */

:root {
  --blue: #2d4486;
  --blue-deep: #22366d;
  --blue-soft: #eef2fb;

  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel2: #f8f9fc;

  --text: #111827;
  --muted: #5b6475;

  --line: rgba(45, 68, 134, 0.14);

  --radius: 10px;
  --radius-sm: 7px;

  --font-base: "Noto Sans JP", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-base);
  background: var(--bg);
  color: var(--text);
}

/* =========================
   Login Page
========================= */

.loginPage {
  height: 100vh;
  overflow: hidden;
}

.backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: linear-gradient(
    135deg,
    rgba(45, 68, 134, 0.1),
    rgba(244, 246, 250, 0.96)
  );
}

.loginStack {
  width: min(520px, 100%);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.loginModal {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(45, 68, 134, 0.16);
}

/* =========================
   Header
========================= */

.modalHead {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel2);
}

.modalHead b {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

/* =========================
   Form
========================= */

.stylishForm {
  padding: 18px;
}

.fRow {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fField {
  position: relative;
  padding: 10px 10px 8px;
  border-radius: 8px;
}

.fField:hover {
  background: var(--panel2);
}

.fInput {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--text);
  padding: 4px 0 6px;
}

.fLabel {
  position: absolute;
  left: 10px;
  top: 10px;
  color: var(--muted);
  transition: 0.15s;
  pointer-events: none;
}

.fInput:focus + .fLabel,
.fInput:not(:placeholder-shown) + .fLabel {
  opacity: 0;
}

.fLine {
  height: 1px;
  background: rgba(45, 68, 134, 0.18);
  transition: 0.15s;
}

.fField:focus-within .fLine {
  height: 2px;
  background: var(--blue);
}

/* =========================
   Button
========================= */

button {
  appearance: none;
  border: 1px solid rgba(45, 68, 134, 0.26);
  background: #fff;
  color: var(--text);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.06s ease;
}

button:hover {
  background: var(--blue-soft);
  border-color: rgba(45, 68, 134, 0.38);
}

button:active {
  transform: translateY(1px);
}

.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.primary:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}

.secondaryBtn {
  width: 100%;
  border: 1px solid rgba(45, 68, 134, 0.18);
  background: #fff;
  color: var(--text);
}

.secondaryBtn:hover {
  background: var(--panel2);
}

.guestBtn {
  width: 100%;
  margin-top: 10px; /* ←追加 */

  border: 1px dashed rgba(45, 68, 134, 0.32);
  background: #fff;
  color: var(--muted);
}
.guestBtn:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

/* =========================
   Message
========================= */

.loginMsg {
  min-height: 1.2em;
  font-size: 14px;
  color: var(--muted);
}

.loginMsg.isErr {
  color: #dc2626;
}

/* =========================
   Footer
========================= */

.modalFoot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.small {
  font-size: 14px;
  color: var(--muted);
}

.kbd {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  font-size: 12px;
  color: var(--text);
}

.loginDivider {
  height: 1px;
  background: rgba(45, 68, 134, 0.1);
  margin: 8px 0;
}

/* =========================
   Slide
========================= */

.loginSlider {
  display: flex;
  width: 200%;
  transition: transform 0.22s ease;
}

.loginSlider.showGuest {
  transform: translateX(-50%);
}

.loginPane {
  width: 50%;
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  background: var(--panel);
}

.guestLead {
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.7;
}

.guestList {
  margin: 0;
  padding-left: 1.3em;
  color: var(--muted);
  line-height: 1.8;
}

.guestFoot {
  justify-content: flex-end;
}

/* =========================
   Login Version
========================= */

.pageVersion {
  position: fixed;
  left: 16px;
  bottom: 12px;
  z-index: 5;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.75;
  letter-spacing: 0.04em;
  user-select: none;
}

/* =========================
   Login Step
========================= */

.stepList {
  display: flex;
  flex-direction: column;
}

.stepBlock {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  position: relative;

  opacity: 0;
  transform: translateY(8px);
  animation: stepIn 0.18s ease forwards;
}

@keyframes stepIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stepBlock + .stepBlock {
  margin-top: 14px;
}

.stepSide {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.stepNum {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;

  background: var(--blue);
  border: 1px solid var(--blue);
  color: #fff;

  font-size: 17px;
  font-weight: 700;
  z-index: 2;
}

.stepDots {
  flex: 1;
  width: 2px;
  min-height: 36px;
  margin-top: 7px;

  background-image: radial-gradient(
    circle,
    rgba(45, 68, 134, 0.55) 1.5px,
    transparent 1.8px
  );
  background-size: 2px 7px;
  background-repeat: repeat-y;
}

.stepBlock:last-child .stepDots {
  display: none;
}

.stepBody {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.stepBody h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.stepText {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.stepBlock.isDone .stepNum {
  background: var(--blue-soft);
  border-color: rgba(45, 68, 134, 0.2);
  color: var(--blue);
}

.stepBlock.isDone .stepBody {
  background: var(--panel2);
  border-color: rgba(45, 68, 134, 0.1);
}

.stepBlock.isDone .stepBody h2 {
  color: var(--muted);
}

.summaryRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summaryRow b {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nameBox {
  padding: 10px 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
}

.miniBtn {
  flex: 0 0 auto;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--blue);
  border-color: rgba(45, 68, 134, 0.28);
  background: #fff;
}

/* =========================
   Responsive
========================= */

@media (max-width: 560px) {
  body {
    font-size: 13px;
  }

  .backdrop {
    padding: 12px;
  }

  .loginStack {
    gap: 8px;
  }

  .loginModal {
    width: 100%;
    border-radius: 9px;
  }

  .modalHead {
    padding: 11px 14px;
  }

  .modalHead b {
    font-size: 16px;
  }

  .stylishForm {
    padding: 14px;
  }

  .fRow {
    gap: 9px;
  }

  .fField {
    padding: 8px 8px 6px;
  }

  .fInput {
    font-size: 16px;
    padding: 3px 0 5px;
  }

  .fLabel {
    left: 8px;
    top: 8px;
    font-size: 13px;
  }

  button {
    font-size: 13px;
    padding: 9px;
  }

  .modalFoot {
    padding: 9px 14px;
  }

  .small {
    font-size: 11px;
  }

  .kbd {
    padding: 3px 6px;
    font-size: 11px;
  }

  .loginMsg {
    font-size: 12px;
  }

  .guestLead {
    font-size: 13px;
    line-height: 1.6;
  }

  .guestList {
    font-size: 12px;
    line-height: 1.65;
  }

  .pageVersion {
    left: 10px;
    bottom: 8px;
    font-size: 10px;
  }

  .stepBlock {
    grid-template-columns: 32px 1fr;
    gap: 8px;
  }

  .stepNum {
    width: 25px;
    height: 25px;
    font-size: 15px;
  }

  .stepDots {
    min-height: 30px;
  }

  .stepBody {
    padding: 12px;
  }

  .stepBody h2 {
    font-size: 14px;
  }

  .stepText {
    font-size: 12px;
  }

  .summaryRow b {
    font-size: 13px;
  }

  .miniBtn {
    padding: 6px 8px;
    font-size: 12px;
  }

  .nameBox {
    font-size: 15px;
  }
}

/* =========================
   Initial Setup Modal
========================= */

.initialSetupBackdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 14px;

  background: rgba(17, 24, 39, 0.48);
}

.initialSetupBackdrop.isOpen {
  display: flex;
}

.initialSetupModal {
  width: min(480px, 100%);

  overflow: hidden;

  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);

  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.24);
}

.initialSetupPane.isHidden {
  display: none;
}

.initialSetupBody {
  padding: 20px 18px;
}

.initialSetupLead {
  margin: 0;

  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
}

.initialSetupGuide {
  margin-top: 16px;
  padding: 14px;

  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);

  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.initialSetupGuide strong {
  color: var(--text);
  font-weight: 600;
}

.initialSetupGuide ol,
.initialSetupGuide ul {
  margin: 8px 0 0;
  padding-left: 1.4em;
}

.initialSetupList {
  margin-bottom: 0;
}

.initialSetupMessage {
  min-height: 22px;
  margin-top: 12px;
}

.initialSetupMessage.isSuccess {
  color: var(--blue);
}

.initialSetupFoot {
  justify-content: flex-end;
}

.initialSetupFoot button {
  min-width: 110px;
}

.backdrop.isHidden {
  display: none;
}

@media (max-width: 560px) {
  .initialSetupBackdrop {
    padding: 12px;
  }

  .initialSetupModal {
    border-radius: 9px;
  }

  .initialSetupBody {
    padding: 16px 14px;
  }

  .initialSetupLead {
    font-size: 13px;
  }

  .initialSetupGuide {
    margin-top: 13px;
    padding: 12px;

    font-size: 12px;
    line-height: 1.75;
  }

  .initialSetupFoot {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .initialSetupFoot button {
    min-width: 0;
    width: 100%;
  }
}
