/* ---- Login page ---- */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--color-paper);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow-hard);
  padding: 2.5rem 2rem;
}

.auth-logo {
  display: block;
  height: 48px;
  margin: 0 auto 2rem;
}

.auth-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 1.75rem;
  text-align: center;
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-field label {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}

.auth-field input,
.auth-field select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--color-surface);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
  box-shadow: none;
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: var(--color-secondary);
}

.auth-submit {
  width: 100%;
  margin-top: 1.5rem;
}

.auth-error {
  margin-top: 1rem;
  padding: 0.625rem 0.875rem;
  background: #fff0f3;
  border: 2px solid var(--color-magenta);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: var(--color-magenta);
  display: none;
}

.auth-error.visible {
  display: block;
}

/* ---- Admin page ---- */

.admin-page {
  min-height: 100vh;
  background: var(--color-paper);
  padding: 0 0 4rem;
}

.admin-header {
  background: var(--color-surface);
  border-bottom: 2px solid var(--ink);
  padding: 0.875rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-header img {
  height: 26px;
  flex-shrink: 0;
}

.admin-header-divider {
  width: 2px;
  height: 18px;
  background: var(--ink);
  opacity: 0.15;
  border-radius: 1px;
}

.admin-header-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
}

.admin-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-header-user {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  opacity: 0.45;
}


.admin-content {
  max-width: 900px;
  margin: 2.25rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 292px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 680px) {
  .admin-content {
    grid-template-columns: 1fr;
  }
}

.account-content {
  max-width: 480px;
  margin: 2.25rem auto;
  padding: 0 1.5rem;
}

/* ---- Cards ---- */

.admin-card {
  background: var(--color-surface);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow-hard);
  overflow: hidden;
}

.admin-card-header {
  padding: 0.875rem 1.25rem;
  border-bottom: 2px solid var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--color-surface-soft);
}

.admin-card-body {
  padding: 1.25rem;
}

/* ---- Accounts table ---- */

.accounts-table {
  width: 100%;
  border-collapse: collapse;
}

.accounts-table thead {
  background: var(--color-surface-soft);
  border-bottom: 1px solid var(--line);
}

.accounts-table th {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  opacity: 0.4;
  text-align: left;
  padding: 0.625rem 1.25rem;
  white-space: nowrap;
}

.accounts-table th:last-child {
  text-align: right;
}

.accounts-table td {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.accounts-table td:last-child {
  text-align: right;
  white-space: nowrap;
}

.accounts-table tbody tr:hover {
  background: var(--color-surface-soft);
}

/* ---- Role badge ---- */

.role-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.role-badge.admin {
  background: var(--color-accent);
  color: var(--ink);
}

.role-badge.educator {
  background: var(--color-secondary-soft);
  color: var(--ink);
}

.role-badge.learner {
  background: #e8f5e9;
  color: var(--ink);
}

/* ---- Role select (inline in table) ---- */

.role-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0.125rem 1.5rem 0.125rem 0.5rem;
  border-radius: 4px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1.5px solid var(--ink);
  cursor: pointer;
  box-shadow: none;
  min-height: unset;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231A1E5C' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  transition: border-color 0.15s;
}

.role-select.role-admin {
  background-color: var(--color-accent);
  color: var(--ink);
  border-color: var(--ink);
}

.role-select.role-educator {
  background-color: var(--color-secondary-soft);
  color: var(--ink);
  border-color: var(--ink);
}

.role-select.role-learner {
  background-color: #e8f5e9;
  color: var(--ink);
  border-color: var(--ink);
}

.role-select:focus {
  outline: none;
  border-color: var(--color-secondary);
}

/* ---- Table action buttons ---- */

.btn-sm {
  padding: 0.3125rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
  box-shadow: var(--shadow-hard-sm);
}

.btn-danger {
  background: #fff0f3;
  color: var(--color-magenta);
  border: 2px solid var(--color-magenta);
  box-shadow: 2px 2px 0 var(--color-magenta);
}

.btn-danger:hover {
  background: var(--color-magenta);
  color: #fff;
}

/* ---- Empty / loading state ---- */

.empty-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  opacity: 0.35;
  font-size: 0.9rem;
}

/* ---- Form feedback messages ---- */

.form-message {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  display: none;
}

.form-message.success {
  display: block;
  background: #f0faf4;
  border: 2px solid #2d9e5f;
  color: #1a6640;
}

.form-message.error {
  display: block;
  background: #fff0f3;
  border: 2px solid var(--color-magenta);
  color: var(--color-magenta);
}
