/* ===== Ofucos 排班系統 — 共用樣式 ===== */
/* 複用 ofucos-form 的設計系統 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4ccbe1;
  --primary-dark: #1a6c7a;
  --primary-light: #e6f7fa;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,.10);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
}

/* ===== Topbar ===== */
.topbar {
  background: #143f62;
  color: #fff;
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-user {
  font-size: 0.85rem;
  color: var(--gray-300);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: #143f62; color: #fff; }
.btn-primary:hover { background: #1a6c7a; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-ghost { background: transparent; color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-outline { background: transparent; border: 1px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-100); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-full { width: 100%; }

/* ===== Form Elements ===== */
.field-group { margin-bottom: 16px; }
.field-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color .15s;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}
.required { color: var(--danger); }

/* ===== Activity Cards (for registration) ===== */
.activity-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.activity-card { cursor: pointer; }
.activity-card input { display: none; }
.activity-card .card-content {
  text-align: center;
  padding: 14px 8px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  transition: all .15s;
  user-select: none;
}
.activity-card .card-content:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
}
.activity-card input:checked + .card-content {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(14,165,233,.2);
}
.card-icon { font-size: 1.8rem; margin-bottom: 2px; }
.card-label { font-size: 0.8rem; font-weight: 500; }

/* ===== Container ===== */
.container { max-width: 720px; margin: 0 auto; padding: 24px 16px; }
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--gray-900);
}

/* ===== Login ===== */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 50%, #e8f5e9 100%);
}
.login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-card h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.login-card .subtitle {
  color: var(--gray-500);
  font-size: 0.85rem;
  margin-bottom: 24px;
}
.login-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.login-tab {
  flex: 1;
  padding: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all .15s;
  color: var(--gray-500);
}
.login-tab.active {
  background: var(--primary);
  color: #fff;
}
.pw-wrapper {
  position: relative;
}
.pw-wrapper input { padding-right: 40px; }
.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--gray-400);
  padding: 2px;
  line-height: 1;
}
.pw-toggle:hover { color: var(--gray-700); }

.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 8px;
  min-height: 20px;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 60px;
  right: 16px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--gray-900);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease;
  max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--gray-900); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } }

/* ===== Status Badge ===== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* ===== Hidden ===== */
.hidden { display: none !important; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .activity-cards { grid-template-columns: repeat(2, 1fr); }
  .container { padding: 16px 12px; }
  .card { padding: 16px; }
  .login-card { padding: 28px 20px; }
}
