/* 會員登入視窗、會員區、班別卡。v0.7 加入 */

.login-dialog {
  width: min(420px, 92vw);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--white);
}

.login-dialog::backdrop { background: rgba(0,0,0,.72); }

.login-body { padding: 28px; }

.login-body h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.login-body p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-field {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.login-field input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-light);
  color: var(--white);
  font-size: 15px;
}

.login-field input:focus-visible {
  outline: 2px solid var(--pink-light);
  outline-offset: 1px;
}

.login-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.login-actions button {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--white);
  font-size: 14px;
}

.login-actions button.primary {
  border-color: var(--pink);
  background: var(--pink);
  font-weight: 700;
}

.login-close {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.login-message {
  min-height: 20px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.login-message.is-error { color: var(--pink-light); }

/* 會員區 */

.member-page .category-intro {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#member-admin { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }

.mini-button {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  font-size: 12px;
  white-space: nowrap;
}

.mini-button:hover { border-color: var(--pink); }

.role-tag {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pink);
  color: white;
  font-size: 10px;
  font-weight: 700;
}

.field-list, .class-card { display: grid; gap: 8px; }

.field-row {
  display: flex;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.field-key { width: 76px; flex: none; color: var(--muted); }
.field-value { color: var(--white); }

/* 班別卡：課堂時間地點那一頁 */

.class-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.class-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-light);
}

.class-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.class-card-head strong { font-size: 17px; }

.class-tag {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
}

.class-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* 管理區的表 */

.table-scroll { overflow-x: auto; margin-top: 16px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

.admin-table th, .admin-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.admin-table thead th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.admin-table tbody th { font-weight: 700; }

.admin-table input, .admin-table select {
  width: 100%;
  min-width: 96px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--white);
  font-size: 13px;
}

.table-message {
  padding: 18px 10px;
  color: var(--muted);
  text-align: center;
}

.ver { color: var(--muted); font-size: 12px; }

@media (max-width: 700px) {
  .login-body { padding: 22px; }
  .login-actions { flex-direction: column; }
  .class-list { grid-template-columns: 1fr; }
  .field-key { width: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
/* A段個人檔案表單，手機單欄並保留清楚標籤 */
.profile-form { display: grid; gap: 16px; max-width: 600px; }
.profile-control { display: grid; gap: 8px; min-width: 0; }
.profile-control input, .profile-control select { width: 100%; min-width: 0; padding: 12px; font: inherit; color: var(--white); background: var(--surface); border: 1px solid var(--line); }
.measurement-history { padding-left: 22px; line-height: 1.9; overflow-wrap: anywhere; }
#student-details { margin-top: 20px; }
.jersey-request-form { margin: 12px 0 20px; }
.jersey-request-form p { margin: 0; overflow-wrap: anywhere; }
.jersey-request-review { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.jersey-request-review p { white-space: normal; overflow-wrap: anywhere; }
.jersey-request-review .mini-button { min-height: 44px; }
/* 學員表格球衣欄獨立排列，避免按鈕超出欄界 */
#admin-members td:nth-child(4) { min-width: 160px; white-space: normal; padding-top: 57px; }
#admin-members td:nth-child(4) input { display: block; max-width: 180px; }
#admin-members td:nth-child(4) button { display: block; margin-top: 10px; }
#admin-members td:nth-child(4) [role="status"] { display: block; margin-top: 8px; overflow-wrap: anywhere; }
#admin-members td:nth-child(5), .admin-table:has(#admin-members) thead th:nth-child(5) { padding-left: 32px; min-width: 280px; }
/* 我的套餐卡：只讀，欄名較長所以加闊 */
#student-package { margin: 12px 0 32px; }
#student-package .field-key { width: 104px; }
.package-message { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--white); font-size: 14px; line-height: 1.6; }
#student-package[data-state="expired"] .package-message { border-color: var(--pink); }
.package-note { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

/* 學員區：長文字可換行，手機表單及儲存按鈕保留足夠操作空間。 */
#member-student .field-value { min-width: 0; overflow-wrap: anywhere; }
#member-student .mini-button, #member-logout { min-height: 44px; }
#member-student .profile-form > .mini-button { justify-self: start; min-width: 144px; }
@media (max-width: 700px) {
  #member-student { padding: 24px; }
}

/* 只限管理員的誤綁更正，沿用既有登入視窗與表單樣式。 */
.jersey-correction-dialog { width: min(600px, 92vw); max-height: 90dvh; overflow-y: auto; }
.jersey-correction-dialog .mini-button { min-height: 44px; }
.jersey-correction-dialog p { overflow-wrap: anywhere; white-space: normal; }
