/* 員工端（手機打卡、綁定、櫃台平板）共用樣式：悅兒橘色主題 */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --orange: #F97316;
  --orange-dark: #C2410C;
  --orange-soft: #FFEDD5;
  --cream: #FFF8F2;
  --green: #22C55E;
  --green-dark: #15803D;
  --red: #DC2626;
  --card: rgba(255, 255, 255, 0.94);
  --text: #431407;
  --muted: #9A7B6A;
  --line: rgba(249, 115, 22, 0.14);
  --radius: 22px;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: linear-gradient(175deg, var(--cream) 0%, #FFF3E8 60%, #FFECD2 100%);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.brand-name { font-size: 1.05rem; font-weight: 700; color: var(--orange-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock { text-align: right; flex-shrink: 0; }
.clock-time { font-size: 1.35rem; font-weight: 800; color: var(--orange-dark); font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
.clock-date { font-size: 0.75rem; color: var(--muted); }

.page { flex: 1; width: 100%; max-width: 480px; margin: 0 auto; padding: 20px 16px 72px; display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: 0 6px 28px rgba(194, 65, 12, 0.08);
  border: 1px solid var(--line);
}
.card h1 { font-size: 1.35rem; color: var(--orange-dark); margin-bottom: 6px; text-align: center; }
.card .sub { color: var(--muted); font-size: 0.92rem; text-align: center; line-height: 1.6; }

.punch-buttons { display: grid; gap: 14px; margin-top: 20px; }
.btn-punch {
  border: none; border-radius: 18px; color: #fff; cursor: pointer;
  font-family: inherit; font-size: 1.35rem; font-weight: 800; letter-spacing: 2px;
  padding: 26px 16px; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform 0.1s ease, filter 0.2s ease, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-punch:active { transform: scale(0.97); }
.btn-punch:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-punch .icon { font-size: 1.6rem; }
.btn-in { background: linear-gradient(135deg, #34D399, var(--green) 55%, var(--green-dark)); box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3); }
.btn-out { background: linear-gradient(135deg, #FDBA74, var(--orange) 55%, var(--orange-dark)); box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 14px; cursor: pointer; font-family: inherit;
  font-size: 1.05rem; font-weight: 700; padding: 15px 20px; width: 100%;
  background: var(--orange); color: #fff; transition: opacity 0.2s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--orange-dark); border: 1.5px solid var(--line); }

.notice { border-radius: 14px; padding: 14px 16px; font-size: 0.95rem; line-height: 1.6; }
.notice-error { background: #FEF2F2; color: var(--red); border: 1px solid #FECACA; }
.notice-warn { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.notice-ok { background: #F0FDF4; color: var(--green-dark); border: 1px solid #BBF7D0; }
.notice-info { background: var(--orange-soft); color: var(--orange-dark); }
.hidden { display: none !important; }

.consent { font-size: 0.85rem; color: var(--muted); line-height: 1.7; background: #FFFBF7; border-radius: 12px; padding: 14px; border: 1px solid var(--line); }
.consent strong { color: var(--text); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; margin: 14px 0 18px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--orange); margin-top: 2px; flex-shrink: 0; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 0.9rem; font-weight: 700; }
.field select, .field input {
  font-family: inherit; font-size: 1.05rem; padding: 13px 14px; border-radius: 12px;
  border: 1.5px solid #F3D9C4; background: #FFFBF7; color: var(--text); width: 100%;
}
.field select:focus, .field input:focus { outline: none; border-color: var(--orange); }

.steps { display: grid; gap: 10px; margin-top: 16px; }
.step { display: flex; gap: 12px; align-items: center; font-size: 0.95rem; }
.step-no { width: 28px; height: 28px; border-radius: 50%; background: var(--orange-soft); color: var(--orange-dark); font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }

.spinner { width: 34px; height: 34px; border: 4px solid var(--orange-soft); border-top-color: var(--orange); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 8px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 打卡結果 */
.result {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(255, 248, 242, 0.97);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center; gap: 8px;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.result.show { opacity: 1; pointer-events: auto; }
.result-icon { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 3rem; color: #fff; margin-bottom: 8px; animation: pop 0.45s cubic-bezier(.2,1.6,.4,1); }
.result-icon.ok { background: var(--green); box-shadow: 0 10px 30px rgba(34,197,94,.35); }
.result-icon.warn { background: #F59E0B; box-shadow: 0 10px 30px rgba(245,158,11,.35); }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result-type { font-size: 1rem; color: var(--muted); font-weight: 700; }
.result-time { font-size: 3rem; font-weight: 800; color: var(--orange-dark); font-variant-numeric: tabular-nums; line-height: 1.1; }
.result-greeting { font-size: 1.15rem; font-weight: 700; max-width: 360px; line-height: 1.6; }
.result .notice { max-width: 380px; margin-top: 8px; }
.result .btn { max-width: 280px; margin-top: 18px; }

.grass {
  position: fixed; left: 0; right: 0; bottom: 0; height: 34px; pointer-events: none;
  background: linear-gradient(0deg, var(--green) 0%, var(--green) 55%, transparent 100%);
}
.grass::before {
  content: ''; position: absolute; top: -16px; left: 0; right: 0; height: 22px;
  background:
    radial-gradient(ellipse 20px 18px at 10% 100%, var(--green) 70%, transparent 71%),
    radial-gradient(ellipse 24px 20px at 25% 100%, #2DD264 70%, transparent 71%),
    radial-gradient(ellipse 18px 16px at 40% 100%, var(--green) 70%, transparent 71%),
    radial-gradient(ellipse 22px 19px at 55% 100%, #2DD264 70%, transparent 71%),
    radial-gradient(ellipse 20px 17px at 70% 100%, var(--green) 70%, transparent 71%),
    radial-gradient(ellipse 26px 21px at 85% 100%, #2DD264 70%, transparent 71%),
    radial-gradient(ellipse 19px 16px at 95% 100%, var(--green) 70%, transparent 71%);
}
