/* MARUWA Gate Entry - iPad縦UI ブルートーン */

:root {
  --blue-900: #0B2E5C;
  --blue-700: #1E5A8E;
  --blue-500: #2E7BB8;
  --blue-400: #74B2E0;
  --blue-200: #B8D6EF;
  --blue-50:  #EAF3FB;
  --white:    #FFFFFF;
  --gray-700: #4A5568;
  --gray-400: #A0AEC0;
  --shadow:   0 8px 24px rgba(11, 46, 92, 0.18);
  --shadow-lg: 0 16px 48px rgba(11, 46, 92, 0.28);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  background: linear-gradient(160deg, var(--blue-700) 0%, var(--blue-400) 100%);
  color: var(--white);
  user-select: none;
  -webkit-user-select: none;
  overflow-x: hidden;
}

/* iPad縦想定の最大幅コンテナ */
.stage {
  max-width: 820px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 56px 48px;
}

/* 共通ヘッダー */
.brand {
  text-align: center;
  margin-bottom: 24px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--white);
  margin-bottom: 18px;
}

.brand-company {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.16em;
  opacity: 0.92;
}

.brand-title {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-top: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* ステップ表示 */
.steps {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
}

.step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.step-dot.active {
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
}

/* メインカード（白背景の入力エリア） */
.card {
  background: var(--white);
  color: var(--gray-700);
  border-radius: 28px;
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--blue-700);
  text-align: center;
  margin-bottom: 8px;
}

.card-sub {
  font-size: 16px;
  color: var(--gray-400);
  text-align: center;
  margin-bottom: 32px;
}

/* プライマリボタン */
.btn-primary {
  display: block;
  width: 100%;
  padding: 28px 32px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--white);
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  border: none;
  border-radius: 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 4px 12px rgba(11, 46, 92, 0.18);
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 18px 24px;
  margin-top: 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--blue-700);
  background: transparent;
  border: 2px solid var(--blue-200);
  border-radius: 18px;
  cursor: pointer;
}

.btn-secondary:active {
  background: var(--blue-50);
}

/* === Screen 1: スタート === */
.start-stage {
  justify-content: space-between;
}

.start-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.start-illust {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 3px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px auto 32px;
  position: relative;
}

.start-illust::before {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%   { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 0; }
}

.start-illust svg {
  width: 120px;
  height: 120px;
  fill: var(--white);
}

.start-message {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.7;
  margin-top: 16px;
  opacity: 0.95;
}

/* === Screen 2: 電話番号入力 === */
.phone-display {
  background: var(--blue-50);
  border: 2px solid var(--blue-200);
  border-radius: 18px;
  padding: 28px 20px;
  text-align: center;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--blue-900);
  margin-bottom: 28px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-display.empty {
  color: var(--gray-400);
  letter-spacing: 0.1em;
  font-weight: 500;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.key {
  padding: 22px 0;
  font-size: 32px;
  font-weight: 600;
  color: var(--blue-900);
  background: var(--blue-50);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.08s ease, transform 0.08s ease;
}

.key:active {
  background: var(--blue-200);
  transform: scale(0.96);
}

.key.key-back {
  background: transparent;
  color: var(--blue-700);
  font-size: 22px;
}

.key.key-back:active {
  background: var(--blue-50);
}

/* === Screen 3: 顔認証 === */
.face-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--blue-900);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.face-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 38%, rgba(11, 46, 92, 0.7) 70%);
}

.face-guide {
  width: 60%;
  aspect-ratio: 3 / 4;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 50% / 40%;
  position: relative;
  z-index: 1;
}

.face-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--blue-400) 50%,
    transparent 100%
  );
  box-shadow: 0 0 16px var(--blue-400);
  animation: scan 2.4s ease-in-out infinite;
  z-index: 2;
}

@keyframes scan {
  0%, 100% { top: 18%; opacity: 0; }
  10%      { opacity: 1; }
  50%      { top: 78%; opacity: 1; }
  90%      { opacity: 1; }
}

.face-status {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 46, 92, 0.7);
  color: var(--white);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  z-index: 3;
  backdrop-filter: blur(6px);
}

.face-instr {
  text-align: center;
  font-size: 20px;
  color: var(--gray-700);
  line-height: 1.7;
}

/* === Screen 4: 入場完了 === */
.welcome-stage {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.welcome-check {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 40px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.welcome-check svg {
  width: 96px;
  height: 96px;
  stroke: var(--blue-500);
  stroke-width: 5;
  fill: none;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: draw 0.6s ease-out 0.2s forwards;
}

@keyframes pop {
  0%   { transform: scale(0); }
  100% { transform: scale(1); }
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.welcome-title {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.welcome-name {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  opacity: 0.95;
}

.welcome-time {
  font-size: 18px;
  opacity: 0.8;
  margin-bottom: 56px;
  letter-spacing: 0.1em;
}

.welcome-hint {
  font-size: 16px;
  opacity: 0.75;
  line-height: 1.7;
}
