/* =========================
   Attendance Check - Styles
   ========================= */

:root {
  --bg: #f6f7fb;
  --text: #111827;
  --muted: #6b7280;

  --card-bg: #ffffff;
  --border: #e5e7eb;

  --primary: #2563eb;
  --focus: #93c5fd;

  --danger-bg: #fff1f2;
  --danger-border: #fecdd3;
  --danger-text: #9f1239;

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;

  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  --focus-ring: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR",
    Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Layout */
.wrap {
  flex-direction: column;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* Card */
.card {
  width: 100%;
  max-width: 403px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px 18px;
}

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

/* Typography */
h1 {
  margin: 0 0 12px;
  font-size: 22px;
  letter-spacing: -0.2px;
}

.sub {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}

.foot {
  margin-top: 14px;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  line-height: 1.4;
}

/* Alert */
.alert {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin: 0 0 14px;
  font-size: 14px;
}

/* Form */
label {
  display: block;
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
  font-weight: 600;
}

.row {
  margin-top: 12px;
}

/* Input */
.field {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 16px;
  outline: none;
  background: #fff;
}

.field:focus {
  border-color: var(--focus);
  box-shadow: var(--focus-ring);
}

/* Button */
.btn {
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}

.btn:active {
  transform: scale(0.99);
  opacity: 0.92;
}

.modal{
  position:fixed; inset:0;
  display:none;
  align-items:center; justify-content:center;
  padding:16px;
  z-index:9999;
}
.modal.show{display:flex;}
.modal-backdrop{
  position:absolute; inset:0;
  background:rgba(0,0,0,.45);
}
.modal-card{
  position:relative;
  width:100%;
  max-width:420px;
}
.actions{
  display:flex;
  gap:10px;
  margin-top:12px;
}
.actions .btn{flex:1;}
.btn.danger{
  background:#dc2626;
  color:#fff;
  border:1px solid #dc2626;
}

.name-highlight{
  font-weight: 700;
  color: #2563eb;
}

.title-switch {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.title-switch[hidden] {
  display: none;
}

.title-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
  white-space: nowrap;
  margin-top: 0;
  width: auto;
}

.title-btn:active {
  transform: translateY(1px);
}

.title-btn.is-active {
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.teammate-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 0 0 14px;
}

.teammate-pill {
  background: #e2ebff;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.creator{
  margin-bottom: -13px;
  text-align: right;
  font-size: 11px;
  line-height: 1.2;
  color: rgba(156,163,175,.55); /* 지금 색이랑 비슷한데 더 안정적 */
}

.timetable-float {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 92vw);
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 1000;
}

.timetable-float[hidden] {
  display: none;
}

.timetable-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.timetable-frame {
  width: 100%;
  height: 520px;
  border: 0;
  border-radius: var(--radius-md);
  object-fit: contain;
}
