/* Super Interviewer – role selection & chat */

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--si-bg);
  color: var(--si-text);
  font-family: var(--si-font);
  line-height: 1.5;
}

.layout-main {
  flex: 1 0 auto;
}

:root {
  --si-bg: #0f1419;
  --si-surface: #1a2332;
  --si-surface-hover: #243044;
  --si-border: #2d3a4d;
  --si-text: #e7e9ea;
  --si-text-muted: #8b98a5;
  --si-accent: #1d9bf0;
  --si-accent-hover: #1a8cd8;
  --si-you-bg: #1d9bf0;
  --si-you-text: #fff;
  --si-interviewer-bg: #2d3a4d;
  --si-interviewer-text: #e7e9ea;
  --si-radius: 12px;
  --si-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --si-font-heading: "Unbounded", var(--si-font);
}

h1, h2, h3, h4, h5, h6,
.interviews-index .page-header h1,
.signin-hero-title,
.interview-role-banner-name,
.role-card-name,
.interview-result h2,
.result-feedback h3,
.admin-dashboard .page-header h1,
.admin-form-page h1,
.admin-form-card h1 {
  font-family: var(--si-font-heading);
  text-transform: uppercase;
}

/* Index – role selection */
.interviews-index {
  max-width: 1520px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  text-align: center;
}

@media (min-width: 640px) {
  .interviews-index {
    padding: 2rem 1.5rem;
  }
}

.interviews-index .page-header {
  text-align: center;
  margin-top: 1.25rem;
  margin-bottom: 2.5rem;
}

.interviews-index .page-header h1 {
  font-family: var(--si-font);
  font-size: 2rem;
  font-weight: 700;
  color: var(--si-text);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.interviews-index .tagline {
  color: var(--si-text-muted);
  font-size: 1rem;
  margin: 0;
}

.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 280px));
  grid-auto-rows: auto;
  gap: 1rem;
  justify-content: center;
  max-width: 100%;
}

@media (min-width: 480px) {
  .roles-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 280px));
    gap: 1.25rem;
  }
}

@media (min-width: 768px) {
  .roles-grid {
    gap: 1.5rem;
  }
}

@media (min-width: 1400px) {
  .roles-grid {
    grid-template-columns: repeat(5, 280px);
    grid-auto-rows: 280px;
  }
}

.role-card-form {
  margin: 0;
  width: 100%;
  display: block;
}

.role-card-form button {
  width: 100%;
}

.role-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  aspect-ratio: 1;
  min-width: 0;
  padding: 1rem 1.25rem 0.75rem;
  border: 1px solid rgba(42, 42, 42, 0.12);
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--si-font);
  color: #2A2A2A;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
  box-sizing: border-box;
}

.role-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* Light muted palette – card background and darker button tint */
.role-card--0 { background: #AAD495; }
.role-card--0 .role-card-icon { background: #90B680; color: #F0F0F0; }

.role-card--1 { background: #E8B4A0; }
.role-card--1 .role-card-icon { background: #d49a82; color: #F0F0F0; }

.role-card--2 { background: #9EC5E8; }
.role-card--2 .role-card-icon { background: #7aa8d4; color: #F0F0F0; }

.role-card--3 { background: #C4B5D8; }
.role-card--3 .role-card-icon { background: #a89ac4; color: #F0F0F0; }

.role-card--4 { background: #F5E6A3; }
.role-card--4 .role-card-icon { background: #e0d078; color: #2A2A2A; }

.role-card--5 { background: #A8D5BA; }
.role-card--5 .role-card-icon { background: #8bc4a0; color: #F0F0F0; }

.role-card-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.role-card-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.2rem;
  line-height: 1.2;
  color: #2A2A2A;
}

.role-card-title {
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #2A2A2A;
}

.role-card-score {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 700;
  margin-top: 0.35rem;
  padding: 0.25rem 0.5rem;
  background: rgba(42, 42, 42, 0.12);
  border-radius: 6px;
  color: #2A2A2A;
}

.role-card-avatar {
  flex: 1;
  min-height: 0;
  width: 100%;
  margin-top: 0.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.role-card-avatar img {
  height: min(340px, 100%);
  max-height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: bottom center;
}

/* Show – interview chat */
.interview-show {
  display: flex;
  flex-direction: column;
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 1.5rem 1.5rem;
}

@media (max-width: 640px) {
  .interview-show {
    padding: 0 1rem 1rem;
  }
}

.interview-header {
  margin-top: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--si-border);
  flex-shrink: 0;
}

.password-edit-page .interview-header {
  border-bottom: none;
}

.interview-header .back-link {
  display: inline-block;
  position: relative;
  z-index: 2;
  color: var(--si-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.interview-header .back-link:hover {
  color: var(--si-accent);
}

.interview-header h1 {
  font-family: var(--si-font);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--si-text);
  margin: 0 0 0.25rem;
}

/* Plain header (name + tagline + actions, no avatar/banner) */
.interview-header-plain {
  margin-top: 0.5rem;
}

.interview-header .interview-header-plain h1 {
  font-size: 3.25rem !important;
  font-weight: 700;
  color: var(--si-text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  .interview-header {
    margin-top: 1rem;
    padding: 1rem 0;
  }

  .interview-header .interview-header-plain h1 {
    font-size: 2rem !important;
  }
}

/* My sessions page – ensure name is large */
.my-sessions-page .my-sessions-name .my-sessions-name-title {
  font-size: 3.5rem !important;
  font-weight: 700;
  line-height: 1.15;
}

.interview-header-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Interview role banner – same mascot & color as role cards */
.interview-role-banner {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  border: 1px solid rgba(42, 42, 42, 0.08);
  margin-top: 0.5rem;
  color: #2A2A2A;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: visible;
  position: relative;
}

.interview-role-banner--0 { background: #AAD495; }
.interview-role-banner--1 { background: #E8B4A0; }
.interview-role-banner--2 { background: #9EC5E8; }
.interview-role-banner--3 { background: #C4B5D8; }
.interview-role-banner--4 { background: #F5E6A3; }
.interview-role-banner--5 { background: #A8D5BA; }

@media (min-width: 769px) {
  .interview-role-banner {
    margin-top: 1.25rem;
  }
}

.interview-role-banner-avatar {
  position: absolute;
  left: -48px;
  bottom: 0;
  width: 260px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border-radius: 0;
}

.interview-role-banner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.interview-role-banner-text {
  flex: 1;
  min-width: 0;
  padding-left: 200px;
}

@media (max-width: 768px) {
  .interview-role-banner-avatar {
    width: 140px;
    height: 100px;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    justify-content: flex-start;
  }

  .interview-role-banner-avatar img {
    object-position: left center;
  }

  .interview-role-banner-text {
    padding-left: 100px;
  }
}

.interview-role-banner-name {
  font-family: var(--si-font);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 0.25rem;
  color: #000 !important;
  line-height: 1.2;
}

.interview-role-banner .interview-role-banner-designation {
  margin: 0;
  font-size: 0.9375rem;
  color: #000;
  font-weight: 500;
}

.interview-banner-action {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #2A2A2A;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  text-decoration: none;
}

.interview-banner-action:hover {
  background: rgba(0, 0, 0, 0.14);
}

.interview-role-banner-interviewer {
  margin: 0;
  font-size: 0.9375rem;
  color: rgba(0, 0, 0, 0.7);
  font-weight: 500;
}

.interview-role-banner-description {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: rgba(0, 0, 0, 0.6);
  line-height: 1.4;
}

.session-status {
  font-size: 0.8125rem;
  color: var(--si-text-muted);
  margin: 0;
}

.messages-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 0;
}

.message {
  margin-bottom: 1rem;
  max-width: 90%;
}

.message--assistant {
  margin-right: auto;
}

.message--user {
  margin-left: auto;
}

.message-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--si-text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.message--user .message-label {
  text-align: right;
}

.message-content {
  padding: 0.75rem 1rem;
  border-radius: var(--si-radius);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.message--assistant .message-content {
  background: var(--si-interviewer-bg);
  color: var(--si-interviewer-text);
}

.message--user .message-content {
  background: var(--si-you-bg);
  color: var(--si-you-text);
}

.message-content p {
  margin: 0 0 0.5rem;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.interview-rules {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--si-text-muted);
}

.reply-form-container {
  flex-shrink: 0;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--si-border);
}

.reply-form-container--sticky {
  position: sticky;
  bottom: 0;
  background: var(--si-bg);
  padding-bottom: env(safe-area-inset-bottom, 0);
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  margin-bottom: -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
}

.reply-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
}

.reply-form .reply-submit {
  align-self: flex-start;
  width: auto;
}

.reply-input {
  flex: 1;
  min-height: 72px;
  padding: 0.75rem 1rem;
  background: var(--si-surface);
  border: 1px solid var(--si-border);
  border-radius: var(--si-radius);
  color: var(--si-text);
  font-family: var(--si-font);
  font-size: 0.9375rem;
  resize: vertical;
}

.reply-input::placeholder {
  color: var(--si-text-muted);
}

.reply-input:focus {
  outline: none;
  border-color: var(--si-accent);
}

.reply-submit {
  padding: 0.75rem 1.25rem;
  background: var(--si-accent);
  color: #fff;
  border: none;
  border-radius: var(--si-radius);
  font-family: var(--si-font);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  flex-shrink: 0;
}

.reply-submit:hover {
  background: var(--si-accent-hover);
}

.reply-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Interview result (rating + feedback) */
.interview-result {
  background: var(--si-surface);
  border: 1px solid var(--si-border);
  border-radius: var(--si-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.interview-result h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--si-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.result-score {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--si-accent);
  margin: 0 0 1rem;
  line-height: 1;
}

.result-out-of {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--si-text-muted);
}

.result-feedback {
  border-top: 1px solid var(--si-border);
  padding-top: 1rem;
}

.result-feedback h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--si-text-muted);
}

.result-feedback p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Recent results on index */
.recent-results {
  margin-bottom: 2rem;
}

.recent-results h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--si-text-muted);
  margin: 0 0 0.75rem;
}

.results-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--si-surface);
  border: 1px solid var(--si-border);
  border-radius: var(--si-radius);
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.result-item:hover {
  border-color: var(--si-accent);
}

.result-role {
  font-weight: 500;
  flex: 1;
}

.result-date {
  font-size: 0.875rem;
  color: var(--si-text-muted);
}

.result-score {
  font-weight: 600;
  color: var(--si-accent);
}

/* Floating toasts */
.toast-container {
  position: fixed !important;
  top: 6rem !important;
  right: 1.5rem !important;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

/* Slightly lower for non–logged-in (application layout with top-nav) */
body:not(.admin-body) .toast-container {
  top: 6.5rem !important;
}

.toast-container > * {
  pointer-events: auto;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--si-radius);
  font-size: 0.9375rem;
  line-height: 1.4;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.3s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-message {
  flex: 1;
}

.toast-close {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  border-radius: 4px;
}

.toast-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.toast--notice {
  background: var(--si-surface);
  color: #7ec8f3;
  border: 1px solid var(--si-accent);
}

.toast--alert {
  background: var(--si-surface);
  color: #f28b82;
  border: 1px solid #e57373;
}

/* Top nav */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--si-border);
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .top-nav {
    padding: 0.75rem 1.5rem;
  }
}

/* Admin full-body layout with header */
.admin-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--si-bg);
}

.admin-header {
  flex-shrink: 0;
  width: 100%;
  background: var(--si-surface);
  border-bottom: 1px solid var(--si-border);
  padding: 0.75rem 1rem;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .admin-header {
    padding: 0.75rem 1.5rem;
  }
}

.admin-header-inner {
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--si-text);
}

.admin-header-brand:hover {
  color: var(--si-accent);
}

.admin-header-logo {
  height: 32px;
  width: auto;
  display: block;
}

.admin-header-title {
  font-family: var(--si-font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-header-link {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--si-text-muted);
  text-decoration: none;
  border-radius: 6px;
}

.admin-header-link:hover {
  color: var(--si-accent);
  background: rgba(29, 155, 240, 0.1);
}

.admin-header-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-family: var(--si-font);
  font-weight: 500;
  color: var(--si-text);
  background: transparent;
  border: 1px solid var(--si-border);
  border-radius: 6px;
  cursor: pointer;
}

.admin-header-btn:hover {
  border-color: var(--si-accent);
  color: var(--si-accent);
}

.admin-body .admin-main {
  flex: 1 0 auto;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.admin-footer {
  flex-shrink: 0;
  margin-top: auto;
}

/* Site footer */
.site-footer {
  width: 100%;
  margin: 2rem 0 0;
  padding: 1rem 1rem 1.5rem;
  border-top: 1px solid var(--si-border);
  text-align: center;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .site-footer {
    padding: 1.25rem 1.5rem 2rem;
  }
}

.site-footer-inner {
  max-width: 100%;
}

.site-footer-text {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  color: var(--si-text-muted);
}

.site-footer-text:last-of-type {
  margin-bottom: 0;
}

.site-footer-links {
  margin: 0;
  font-size: 0.875rem;
  color: var(--si-text-muted);
}

.site-footer-link {
  color: var(--si-accent);
  text-decoration: none;
}

.site-footer-link:hover {
  text-decoration: underline;
}

.site-footer-sep {
  margin: 0 0.5rem;
  color: var(--si-text-muted);
  opacity: 0.7;
}

.nav-brand {
  font-weight: 600;
  color: var(--si-text);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-brand:hover {
  color: var(--si-accent);
}

.nav-logo {
  height: 32px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}

.nav-brand:hover .nav-logo {
  opacity: 0.9;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 480px) {
  .nav-links {
    gap: 0.5rem;
  }
}

.nav-link {
  color: var(--si-text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

.nav-link:hover {
  color: var(--si-accent);
}

.nav-link--primary {
  color: var(--si-accent);
  font-weight: 500;
}

.nav-phone,
.nav-name {
  font-size: 0.875rem;
  color: var(--si-text-muted);
}

/* Nav name link (My feedback) – scoped so styles apply */
.top-nav .nav-links a.nav-name.nav-name--link,
.top-nav .nav-links a.nav-name.nav-name--link:hover,
.top-nav .nav-links a.nav-name.nav-name--link:focus,
.top-nav .nav-links a.nav-name.nav-name--link:visited {
  text-decoration: none;
}

.top-nav .nav-links a.nav-name.nav-name--link {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
  color: var(--si-text-muted);
}

.top-nav .nav-links a.nav-name.nav-name--link:hover {
  color: var(--si-accent);
  background-color: var(--si-surface-hover);
}

.nav-btn {
  padding: 0.4rem 0.75rem;
  background: transparent;
  border: 1px solid var(--si-border);
  border-radius: 8px;
  color: var(--si-text-muted);
  font-family: var(--si-font);
  font-size: 0.875rem;
  cursor: pointer;
}

.nav-btn:hover {
  border-color: var(--si-accent);
  color: var(--si-accent);
}

/* Auth – sign up / sign in */
.auth-page {
  max-width: 400px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Student sign-in – hero + form */
.signin-page {
  max-width: 520px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.signin-hero {
  text-align: center;
}

.signin-hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--si-accent);
  margin-bottom: 1rem;
}

.signin-hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--si-text);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.signin-hero-tagline {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--si-accent);
  margin: 0 0 0.75rem;
}

.signin-hero-desc {
  font-size: 0.9375rem;
  color: var(--si-text-muted);
  margin: 0;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.signin-form-wrapper {
  flex-shrink: 0;
}

.signin-form-card {
  padding: 1.75rem;
}

.signin-form-heading {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.auth-card {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  background: var(--si-surface);
  border: 1px solid var(--si-border);
  border-radius: var(--si-radius);
  padding: 1.5rem;
}

.auth-card h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.auth-subtitle {
  color: var(--si-text-muted);
  font-size: 0.875rem;
  margin: 0 0 1.25rem;
}

.auth-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.auth-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1rem;
  background: var(--si-bg);
  border: 1px solid var(--si-border);
  border-radius: 8px;
  color: var(--si-text);
  font-family: var(--si-font);
  font-size: 0.9375rem;
}

.auth-input:focus {
  outline: none;
  border-color: var(--si-accent);
}

.auth-input::placeholder {
  color: var(--si-text-muted);
}

.password-input-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.password-input-wrap .password-input {
  margin-bottom: 0;
  padding-right: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--si-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.password-toggle-btn:hover {
  color: var(--si-accent);
}

.password-icon {
  display: block;
  flex-shrink: 0;
}

.password-icon.is-hidden {
  display: none;
}

.auth-errors {
  color: #f28b82;
  font-size: 0.875rem;
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.auth-submit {
  width: 100%;
  padding: 0.875rem 1.25rem;
  margin-top: 0.5rem;
  background: var(--si-accent);
  color: #fff;
  border: none;
  border-radius: var(--si-radius);
  font-family: var(--si-font);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.1s ease;
  text-decoration: none;
  min-height: 2.75rem;
  -webkit-tap-highlight-color: transparent;
}

.auth-submit:hover {
  background: var(--si-accent-hover);
}

.auth-submit:focus-visible {
  outline: 2px solid var(--si-accent);
  outline-offset: 2px;
}

.auth-submit:active {
  transform: scale(0.98);
}

.auth-footer {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--si-border);
  font-size: 0.875rem;
  color: var(--si-text-muted);
}

.auth-footer--row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.auth-footer-sep {
  color: var(--si-text-muted);
  margin: 0 0.15rem;
}

.auth-link {
  color: var(--si-accent);
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-link-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
  background: var(--si-border);
  color: var(--si-text-muted);
  border: none;
  border-radius: 8px;
  font-family: var(--si-font);
  font-size: 0.875rem;
  cursor: pointer;
}

.auth-link-btn:hover {
  background: var(--si-text-muted);
  color: var(--si-surface);
}

/* Resend as link style (admin repo) */
.auth-resend-link {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--si-font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--si-accent);
  cursor: pointer;
  text-decoration: none;
  display: inline;
}

.auth-resend-link:hover {
  text-decoration: underline;
}

.auth-form--resend {
  margin-top: 0.5rem;
}

/* Centered auth (verify page, admin repo alignment) */
.auth-card--centered h1,
.auth-card--centered .auth-subtitle,
.auth-card--centered .auth-otp-label {
  text-align: center;
}

.auth-card--centered .auth-otp-row {
  margin-left: auto;
  margin-right: auto;
}

.auth-card--centered .auth-footer {
  text-align: center;
}

.auth-divider {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--si-border);
  text-align: center;
}

.auth-divider-text {
  font-size: 0.75rem;
  color: var(--si-text-muted);
  margin-bottom: 0.5rem;
}

.auth-timer-text {
  font-size: 0.875rem;
  color: var(--si-text-muted);
  margin: 0.25rem 0 0;
}

.auth-divider form,
.auth-divider .button_to {
  display: inline;
}

.auth-footer--row form,
.auth-footer--row .button_to {
  display: inline;
}

.auth-form--resend .auth-submit,
.auth-form--resend .auth-link-btn {
  margin-bottom: 0;
}

.auth-otp-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.auth-otp-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  justify-content: flex-start;
  align-items: center;
  width: max-content;
  max-width: 100%;
}

.auth-otp-row input {
  flex: 0 0 auto;
}

/* OTP digit inputs: exactly 1 digit per box, one row only (override .auth-input width: 100%) */
.auth-otp-row input.auth-input,
.auth-otp-row .auth-otp-input,
.auth-otp-row input[type="text"],
.auth-form .auth-otp-row .auth-input,
.auth-form .auth-otp-row input {
  width: 2.75rem !important;
  min-width: 2.75rem !important;
  max-width: 2.75rem !important;
  flex: 0 0 2.75rem !important;
  text-align: center;
  margin-bottom: 0;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  box-sizing: border-box;
}

/* Admin dashboard */
.admin-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.admin-dashboard .page-header {
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
}

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

.btn-primary {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--si-accent);
  color: #fff;
  border-radius: 8px;
  font-family: var(--si-font);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--si-accent-hover);
}

.btn-secondary {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--si-text-muted);
  border: 1px solid var(--si-border);
  border-radius: 8px;
  font-family: var(--si-font);
  font-size: 0.9375rem;
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--si-accent);
  color: var(--si-accent);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
  margin-top: 1rem;
}

.form-actions .auth-submit {
  width: auto;
}

.form-actions--right {
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 480px) {
  .form-actions--right {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions--right .auth-submit {
    width: 100%;
  }
}

.admin-form-page {
  max-width: 400px;
  margin: 1.25rem auto 0;
}

.admin-form-card {
  background: var(--si-surface);
  border: 1px solid var(--si-border);
  border-radius: var(--si-radius);
  padding: 1.5rem;
}

.admin-form-card h1 {
  font-size: 1.25rem;
  margin: 0 0 0.25rem;
}

.admin-dashboard .page-header h1 {
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

.dashboard-table-wrap {
  overflow-x: auto;
  width: 100%;
  box-sizing: border-box;
}

.dashboard-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  background: var(--si-surface);
  border-radius: var(--si-radius);
  border: 1px solid var(--si-border);
}

.dashboard-table th,
.dashboard-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--si-border);
}

.dashboard-table th {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--si-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dashboard-table tr:last-child td {
  border-bottom: none;
}

.cell-student {
  font-weight: 500;
}

.cell-student .cell-name {
  display: block;
  font-weight: 600;
  color: var(--si-text);
}

.cell-student .cell-phone {
  display: block;
  font-size: 0.8125rem;
  color: var(--si-text-muted);
  font-weight: 400;
}

.cell-level {
  font-size: 0.75rem;
  color: var(--si-text-muted);
  font-weight: 400;
  margin-left: 0.25rem;
}

.text-muted {
  color: var(--si-text-muted);
}

.score-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.score-input {
  width: 4rem;
  padding: 0.4rem 0.5rem;
  background: var(--si-bg);
  border: 1px solid var(--si-border);
  border-radius: 6px;
  color: var(--si-text);
  font-family: var(--si-font);
  font-size: 0.875rem;
}

.score-submit {
  padding: 0.4rem 0.6rem;
  background: var(--si-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--si-font);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.score-submit:hover {
  background: var(--si-accent-hover);
}

.dashboard-empty {
  color: var(--si-text-muted);
  text-align: center;
  padding: 2rem;
}

.link-edit {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.8125rem;
  color: var(--si-accent);
  text-decoration: none;
}

.link-edit:hover {
  text-decoration: underline;
}

.role-options {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--si-border);
  border-radius: 8px;
}

.role-options legend {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0 0.25rem;
}

.role-checkbox {
  display: block;
  margin: 0.5rem 0;
  font-size: 0.9375rem;
  cursor: pointer;
}

.role-checkbox input {
  margin-right: 0.5rem;
}

/* Dashboard redesign – stats and cards */
.dashboard-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dashboard-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--si-surface);
  border: 1px solid var(--si-border);
  border-radius: var(--si-radius);
  padding: 1rem 1.25rem;
  min-width: 140px;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--si-text);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--si-text-muted);
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.dashboard-card {
  background: var(--si-surface);
  border: 1px solid var(--si-border);
  border-radius: var(--si-radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dashboard-card:hover {
  border-color: var(--si-accent);
}

.dashboard-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.dashboard-card-identity {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dashboard-card-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--si-text);
}

.dashboard-card-meta {
  font-size: 0.8125rem;
  color: var(--si-text-muted);
}

.dashboard-card-level {
  font-size: 0.75rem;
  color: var(--si-accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dashboard-card-link {
  font-size: 0.875rem;
  color: var(--si-accent);
  text-decoration: none;
  white-space: nowrap;
}

.dashboard-card-link:hover {
  text-decoration: underline;
}

.dashboard-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--si-text-muted);
}

.card-stat {
  color: var(--si-text-muted);
}

.card-stat-score {
  color: var(--si-text);
}

.dashboard-card-actions {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--si-border);
}

.dashboard-empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.dashboard-empty-state .btn-primary {
  margin-top: 0.5rem;
}

/* Student detail page */
.admin-student-detail {
  max-width: 720px;
}

.admin-student-detail .back-link {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--si-text-muted);
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.admin-student-detail .back-link:hover,
.student-detail .back-link:hover {
  color: var(--si-accent);
}

/* Student-facing detail (same layout as admin student show) */
.student-detail {
  max-width: 720px;
}

.student-detail .back-link {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--si-text-muted);
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.student-detail-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
}

.student-detail-header h1 {
  margin: 0 0 0.15rem;
}

.student-detail-actions {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.student-profile-card {
  background: var(--si-surface);
  border: 1px solid var(--si-border);
  border-radius: var(--si-radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .student-profile-card,
  .student-sessions-section {
    padding: 1rem 1rem;
  }

  .profile-dl {
    gap: 0.35rem 1rem;
    font-size: 0.875rem;
  }

  .student-profile-card-actions {
    margin-top: 1.5rem;
  }
}

.student-profile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.student-profile-card-header .section-title {
  margin-bottom: 0;
}

.student-profile-card-actions {
  margin-top: 2.25rem;
}

.btn-primary--small {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
}

.section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--si-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 1rem;
}

.profile-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.5rem;
  margin: 0;
  font-size: 0.9375rem;
}

.profile-dl dt {
  color: var(--si-text-muted);
  font-weight: 500;
}

.profile-dl dd {
  margin: 0;
  color: var(--si-text);
}

.student-sessions-section {
  background: var(--si-surface);
  border: 1px solid var(--si-border);
  border-radius: var(--si-radius);
  padding: 1.25rem 1.5rem;
}

.student-sessions-section .section-title {
  margin-bottom: 1rem;
}

.sessions-table-wrap {
  overflow-x: auto;
}

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

.sessions-table th,
.sessions-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--si-border);
  vertical-align: middle;
}

@media (max-width: 640px) {
  .sessions-table th,
  .sessions-table td {
    padding: 0.5rem 0.5rem;
    font-size: 0.8125rem;
  }

  .sessions-table th {
    font-size: 0.7rem;
  }

  .feedback-row .feedback-cell {
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
  }
}

.sessions-table th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--si-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sessions-table tbody tr:last-child td {
  border-bottom: none;
}

.feedback-row .feedback-cell {
  background: rgba(0, 0, 0, 0.15);
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--si-border);
}

.feedback-row:last-child .feedback-cell {
  border-bottom: none;
}

.sessions-table .link-view {
  color: var(--si-accent);
  text-decoration: none;
  font-size: 0.875rem;
}

.sessions-table .link-view:hover {
  text-decoration: underline;
}

.my-sessions-page .page-header {
  margin-bottom: 1.5rem;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status--active {
  background: rgba(29, 155, 240, 0.2);
  color: var(--si-accent);
}

.status--completed {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}
