/* =============================
   Catch Tail - Natural Balanced UI
   - no heavy card layout
   - compatible with original/reworked markup
============================= */

* { box-sizing: border-box; }
html { min-height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  padding: 0 0 56px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
  color: #eaf1fb;
  background:
    radial-gradient(900px 540px at 18% 10%, rgba(95, 138, 255, .20), transparent 62%),
    radial-gradient(760px 520px at 88% 24%, rgba(51, 214, 172, .14), transparent 60%),
    linear-gradient(150deg, #0b1018, #101827 48%, #0c121b);
  overflow-x: hidden;
}
body.light-mode {
  color: #182230;
  background:
    radial-gradient(900px 540px at 16% 8%, rgba(84, 122, 255, .13), transparent 60%),
    radial-gradient(760px 520px at 86% 18%, rgba(34, 181, 154, .12), transparent 60%),
    linear-gradient(150deg, #fbfcff, #f1f5f9 54%, #edf4f2);
}

button, input, textarea, select { font: inherit; }
a { color: #9bdcff; text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
body.light-mode a { color: #2563eb; }

/* page flow */
#content,
.app-content {
  width: min(980px, calc(100vw - 34px));
  margin: clamp(28px, 6vw, 58px) auto 0;
  padding: 0;
  text-align: center;
}
.main-screen,
.simple-screen,
.hero-card,
.simple-card,
.wide-card {
  width: 100%;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}

h2 {
  margin: 0 auto 14px;
  max-width: 760px;
  font-size: clamp(28px, 4.8vw, 48px);
  line-height: 1.12;
  letter-spacing: -.035em;
  font-weight: 800;
}
h3 {
  margin: 0 0 14px;
  font-size: clamp(18px, 2.2vw, 22px);
  letter-spacing: -.025em;
}
p {
  margin: 0 auto;
  max-width: 680px;
  color: rgba(234, 241, 251, .78);
  font-size: 15.5px;
  line-height: 1.7;
}
body.light-mode p { color: #475569; }
strong { color: inherit; font-weight: 750; }
.user-greeting { font-size: clamp(18px, 3.5vw, 26px); }

/* main emphasis */
.hero-copy > p,
#content > p:first-of-type,
.countdown-copy {
  margin-top: 8px;
  font-size: clamp(15px, 1.8vw, 18px);
}
#countdown {
  display: block;
  margin: clamp(12px, 2.4vw, 20px) auto 4px;
  font-size: clamp(42px, 9vw, 88px);
  line-height: 1;
  letter-spacing: -.055em;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  color: #fff2bc;
  text-shadow: 0 22px 70px rgba(255, 210, 94, .20);
}
body.light-mode #countdown {
  color: #a45f00;
  text-shadow: 0 18px 60px rgba(164, 95, 0, .14);
}

/* actions */
.button-container,
.hero-actions .button-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: clamp(20px, 3vw, 30px) 0 0;
}
button,
input[type="submit"] {
  appearance: none;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 10px 18px;
  min-height: 42px;
  color: #eef7ff;
  background: rgba(255,255,255,.08);
  box-shadow: none;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
button:hover,
input[type="submit"]:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.28);
}
#attendBtn,
.button-container button:last-child {
  color: #081018;
  background: #eaf6ff;
  border-color: transparent;
  font-weight: 800;
}
#attendBtn:hover,
.button-container button:last-child:hover { background: #ffffff; }
body.light-mode button,
body.light-mode input[type="submit"] {
  color: #172033;
  background: rgba(255,255,255,.66);
  border-color: rgba(15,23,42,.13);
}
body.light-mode button:hover,
body.light-mode input[type="submit"]:hover { background: #fff; }
body.light-mode #attendBtn,
body.light-mode .button-container button:last-child {
  color: #fff;
  background: #172033;
}
.danger-button { background: #e5484d !important; color: #fff !important; }

/* recent list / tables: no boxed card */
.recent-attendance,
.mypage-card,
.table-shell {
  width: min(760px, 100%);
  margin: clamp(34px, 5vw, 56px) auto 0;
  padding-top: clamp(18px, 3vw, 26px);
  border-top: 1px solid rgba(255,255,255,.16);
}
body.light-mode .recent-attendance,
body.light-mode .mypage-card,
body.light-mode .table-shell { border-top-color: rgba(15,23,42,.12); }

table {
  width: 100%;
  margin: 0 auto;
  border-collapse: collapse;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
th, td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.12);
  color: rgba(234,241,251,.88);
}
th {
  color: rgba(234,241,251,.58);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
  background: transparent;
}
tr:last-child td { border-bottom: 0; }
body.light-mode th,
body.light-mode td {
  color: #263244;
  border-bottom-color: rgba(15,23,42,.10);
}
body.light-mode th { color: #7a8798; }

/* forms */
.input-group {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
  max-width: 560px;
  margin: 14px auto;
  text-align: left;
}
.input-group label { color: rgba(234,241,251,.62); text-align: right; }
.input-group input[type="text"],
.input-group input[type="password"],
.input-group input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  color: inherit;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  outline: none;
}
.input-group input:focus { border-color: rgba(155,220,255,.7); }
body.light-mode .input-group label { color: #64748b; }
body.light-mode .input-group input[type="text"],
body.light-mode .input-group input[type="password"],
body.light-mode .input-group input[type="email"] {
  background: rgba(255,255,255,.78);
  border-color: rgba(15,23,42,.13);
}

/* menu */
#topRightContainer {
  position: fixed;
  top: 68px;
  right: max(14px, calc((100vw - 980px) / 2));
  z-index: 1000;
  display: grid;
  justify-items: end;
  gap: 9px;
}
#hamburger {
  width: 40px;
  height: 40px;
  position: relative;
  cursor: pointer;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#hamburger div {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
  transition: .2s ease;
}
#hamburger div:nth-child(1) { top: 13px; }
#hamburger div:nth-child(2) { top: 19px; }
#hamburger div:nth-child(3) { top: 25px; }
#hamburger.open div:nth-child(1) { top: 19px; transform: rotate(45deg); }
#hamburger.open div:nth-child(2) { opacity: 0; }
#hamburger.open div:nth-child(3) { top: 19px; transform: rotate(-45deg); }
#topRightBtn {
  display: none;
  min-width: 140px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(8,14,22,.78);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
#topRightContainer.show #topRightBtn { display: block; }
#topRightBtn a,
#topRightBtn form { display: block; }
#topRightBtn a,
#topRightContainer form button {
  width: 100%;
  padding: 8px 10px;
  color: inherit;
  border-radius: 11px;
  text-align: left;
}
#topRightBtn a:hover,
#topRightContainer form button:hover {
  background: rgba(255,255,255,.08);
  text-decoration: none;
  transform: none;
}
#topRightContainer form button {
  min-height: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
body.light-mode #hamburger { background: rgba(255,255,255,.70); border-color: rgba(15,23,42,.12); }
body.light-mode #topRightBtn { background: rgba(255,255,255,.86); border-color: rgba(15,23,42,.12); }
body.light-mode #topRightBtn a:hover,
body.light-mode #topRightContainer form button:hover { background: rgba(15,23,42,.06); }

/* ads / overlays */
#topAd, #bottomAd { width: 100%; min-height: 50px; text-align: center; position: relative; z-index: 5; }
#bottomAd { position: sticky; top: calc(100vh - 56px); margin-top: 30px; }
.ad-unit { display: block; }
.ad-unit-top, .ad-unit-bottom { min-height: 50px; }
.ad-unit-mid, .mid-ad-wrap { display: block; margin-top: clamp(24px, 4vw, 42px); min-height: 72px; }

#loadingOverlay,
#modalOverlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  background: rgba(4,8,13,.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
#loadingOverlay { z-index: 2000; }
.spinner,
#turnstileModal,
#toast {
  background: rgba(12,18,28,.88);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  color: #eaf1fb;
}
.spinner { padding: 13px 17px; }
#turnstileModal { width: min(500px, 92vw); padding: 20px; text-align: center; }
#toast {
  visibility: hidden;
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 999;
  min-width: 250px;
  margin-left: -125px;
  padding: 14px 16px;
  text-align: center;
}
#toast.show { visibility: visible; }
body.light-mode #modalOverlay,
body.light-mode #loadingOverlay { background: rgba(241,245,249,.68); }
body.light-mode .spinner,
body.light-mode #turnstileModal,
body.light-mode #toast {
  color: #182230;
  background: rgba(255,255,255,.92);
  border-color: rgba(15,23,42,.12);
}

/* small utilities */
.mt-30 { margin-top: 30px; }
.form-submit { margin-top: 30px; }
.form-submit-small { margin-top: 20px; }
.flash-error { color: #ff7a7a; }
.flash-success { color: #35d5a4; }
.reset-help, .small-muted { color: rgba(234,241,251,.62); font-size: 14px; }
body.light-mode .reset-help,
body.light-mode .small-muted { color: #64748b; }

@media (max-width: 640px) {
  body { padding-bottom: 50px; }
  #content, .app-content { width: min(100vw - 28px, 980px); margin-top: 30px; }
  #topRightContainer { top: 62px; right: 12px; }
  .button-container { flex-direction: column; align-items: stretch; }
  .button-container button { width: 100%; }
  th, td { padding: 10px 5px; font-size: 13.5px; }
}
@media (max-width: 520px) {
  .input-group { grid-template-columns: 1fr; }
  .input-group label { text-align: left; }
  #toast { left: 14px; right: 14px; min-width: 0; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
