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

:root {
  --bg:      #f5f5f5;
  --surface: #ffffff;
  --border:  #e0e0e0;
  --text:    #1a1a1a;
  --muted:   #666;
  --primary: #185FA5;
  --success: #1D9E75;
  --danger:  #E24B4A;
  --radius:  10px;
}

body { font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 16px; }

.navbar {
  background: var(--primary); color: #fff;
  padding: .75rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
}
.navbar a { color: #fff; text-decoration: underline; margin-left: 1rem; }
.nav-brand { font-weight: 600; font-size: 1.1rem; }

.container { max-width: 800px; margin: 2rem auto; padding: 0 1rem; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem;
}
.card-center { max-width: 420px; margin: 3rem auto; }
.card h3 { margin-bottom: 1rem; }

details.card summary { cursor: pointer; font-weight: 500; }

.course-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }

label { display: block; margin: .75rem 0 .25rem; font-weight: 500; font-size: .9rem; }
input[type=text], input[type=password], input[type=number] {
  width: 100%; padding: .6rem .8rem;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 1rem; background: var(--bg);
  outline: none;
}
input:focus { border-color: var(--primary); }

.btn {
  display: inline-block; padding: .55rem 1.1rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text);
  font-size: .9rem; cursor: pointer;
  margin-top: .5rem;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger  { background: var(--danger);  color: #fff; border-color: var(--danger); }

.alert {
  padding: .65rem 1rem; border-radius: 6px;
  margin-bottom: 1rem; font-size: .9rem;
}
.alert-info    { background: #E6F1FB; color: #0C447C; }
.alert-success { background: #E1F5EE; color: #085041; }
.alert-error   { background: #FCEBEB; color: #791F1F; }
.hidden { display: none !important; }
.muted  { color: var(--muted); font-size: .9rem; }

/* TOTP Card */
.totp-card {
  background: var(--surface); border: 2px solid var(--primary);
  border-radius: var(--radius); padding: 1.5rem;
  text-align: center; margin-bottom: 1.5rem;
}
.totp-label { font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }
.totp-code  { font-size: 3rem; font-weight: 700; letter-spacing: .4em; color: var(--primary); }
.totp-bar-wrap { background: var(--border); border-radius: 4px; height: 6px; margin: .75rem 0 .3rem; }
.totp-bar   { height: 6px; border-radius: 4px; transition: width 1s linear, background .3s; }
.totp-timer { font-size: .85rem; color: var(--muted); }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; background: var(--bg); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.5rem; width: 90%; max-width: 400px;
}
.modal h3 { margin-bottom: 1rem; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1rem; }
