:root {
  --ink: #172033;
  --text: #3c465c;
  --muted: #778197;
  --line: #dbe3ee;
  --soft-line: #edf2f7;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --primary: #1b6f8f;
  --primary-dark: #164e63;
  --primary-soft: #e7f4f7;
  --accent: #4f8a5b;
  --accent-soft: #edf7ef;
  --red: #c2413b;
  --red-soft: #fff1f0;
  --gold: #b7791f;
  --shadow: 0 20px 50px rgba(23, 32, 51, 0.11);
  --shadow-soft: 0 10px 26px rgba(23, 32, 51, 0.07);
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(27, 111, 143, 0.10) 0%, rgba(79, 138, 91, 0.08) 44%, transparent 44%),
    linear-gradient(180deg, #fbfcfe 0%, var(--bg) 100%);
  color: var(--text);
  letter-spacing: 0;
}

a { color: inherit; }

button,
input,
select {
  font: inherit;
}

.center-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(320px, 1fr);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(219, 227, 238, 0.85);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(14px);
}

.auth-panel {
  min-height: 560px;
  padding: 42px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(22, 78, 99, 0.90), rgba(23, 32, 51, 0.92)),
    url("https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&w=1200&q=80") center/cover;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-logo {
  width: 74px;
  height: 74px;
  display: block;
  margin-bottom: 22px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
}

.auth-kicker,
.section-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.auth-panel .auth-kicker { color: #9fe3d2; }

.auth-panel h1 {
  margin: 0;
  max-width: 360px;
  color: #fff;
  font-size: 34px;
  line-height: 1.18;
}

.auth-panel p {
  margin: 16px 0 0;
  max-width: 360px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
}

.auth-points {
  display: grid;
  gap: 10px;
  margin-top: 32px;
}

.auth-point {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.auth-point::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9fe3d2;
  box-shadow: 0 0 0 4px rgba(159, 227, 210, 0.14);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 30px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  align-self: center;
  justify-self: center;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 25px;
  color: var(--ink);
}

.login-card .sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.link-row {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.link-row a {
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: none;
}

.link-row a:hover { text-decoration: underline; }

.field { margin-bottom: 15px; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 750;
}

.field input,
.field select,
.resetPw {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.field input:focus,
.field select:focus,
.resetPw:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(27, 111, 143, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  width: 100%;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.btn:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 20px rgba(27, 111, 143, 0.18);
  transform: translateY(-1px);
}

.btn.secondary {
  background: #fff;
  color: var(--primary-dark);
  border-color: var(--line);
}

.btn.secondary:hover {
  background: var(--primary-soft);
  border-color: #b7d9e1;
  box-shadow: none;
}

.btn.danger {
  background: var(--red);
}

.btn.danger:hover {
  background: #9f302b;
}

.btn.small {
  width: auto;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
}

.error-msg {
  margin-top: 12px;
  background: var(--red-soft);
  border: 1px solid #f0b8b4;
  color: #8f211c;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 13px;
  display: none;
  line-height: 1.5;
}

.error-msg.show { display: block; }

.ok-msg {
  background: var(--accent-soft);
  border-color: #b8dfbf;
  color: #246033;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 30px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  padding: 3px;
  object-fit: contain;
  box-shadow: 0 6px 14px rgba(23, 32, 51, 0.08);
}

.topbar .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.main-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 38px 24px 56px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 24px;
}

.page-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.25;
}

.page-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}

.app-card {
  position: relative;
  min-height: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #bcd4de;
}

.app-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 24px;
}

.app-card h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 20px;
}

.app-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.app-card .go {
  margin-top: 22px;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 900;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 22px;
  margin-top: 22px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--soft-line);
  font-size: 14px;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfdff; }

th {
  color: var(--muted);
  font-weight: 850;
  font-size: 12px;
  background: var(--surface-2);
}

.muted {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.badge.admin {
  background: var(--accent-soft);
  color: #246033;
}

.badge.user {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.form-inline {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.form-inline .field { margin-bottom: 0; }

.reset-row {
  display: flex;
  gap: 7px;
  align-items: center;
}

.resetPw {
  width: 138px;
  min-height: 34px;
  padding: 7px 9px;
  font-size: 13px;
}

.hidden { display: none !important; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 20;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: var(--shadow);
}

@media (max-width: 820px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    min-height: auto;
    padding: 30px;
  }

  .auth-panel h1 {
    font-size: 28px;
  }

  .login-card {
    padding: 26px;
  }

  .topbar,
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar .user-info {
    justify-content: flex-start;
  }

  .form-inline {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .center-wrap {
    padding: 16px;
  }

  .auth-panel,
  .login-card,
  .card,
  .panel {
    padding: 22px;
  }

  .topbar {
    padding: 14px 18px;
  }

  .brand {
    white-space: normal;
  }

  .main-wrap {
    padding: 26px 16px 42px;
  }

  .page-head h2 {
    font-size: 23px;
  }

  .form-inline {
    grid-template-columns: 1fr;
  }

  .app-card {
    min-height: 200px;
  }
}

/* 8계통 인증시험 준비중 카드 */
.app-card.disabled {
  opacity: 0.48;
  cursor: not-allowed;
  pointer-events: none;
}

.app-card.disabled .go {
  background: rgba(15, 23, 42, 0.08);
  color: #64748b;
}
