:root {
  --color-primary: #086357;
  --color-primary-light: #0a7d6f;
  --color-secondary: #059669;
  --color-danger: #dc2626;
  --color-warning: #f59e0b;

  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #d9dee6;
  --text: #0f172a;
  --muted: #64748b;
  --focus: rgba(14, 116, 110, 0.2);

  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 20px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body.teacher-body {
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(14, 116, 110, 0.08), transparent 60%),
    linear-gradient(180deg, #f7f9fc 0%, #eff3f8 100%);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.teacher-body.teacher-body-branch-select {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #071d13 0%, #04140d 100%);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

.teacher-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.teacher-card,
.teacher-auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

.teacher-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.teacher-auth-card {
  width: min(520px, 100%);
  padding: 28px;
}

.teacher-auth-card.teacher-branch-select-card {
  width: 100%;
  max-width: 560px;
  padding: 32px;
  border-radius: 22px;
  border: 1px solid rgba(102, 192, 124, 0.25);
  background: rgba(8, 30, 21, 0.92);
  color: #ffffff;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.teacher-auth-card.is-login {
  width: min(980px, 100%);
  padding: 0;
}

.teacher-auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 460px);
  min-height: 600px;
}

.teacher-auth-hero {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 26px;
  padding: 36px;
  color: #ecfeff;
  background:
    radial-gradient(520px 320px at 15% 18%, rgba(255, 255, 255, 0.18), transparent 60%),
    radial-gradient(460px 300px at 85% 12%, rgba(16, 185, 129, 0.22), transparent 62%),
    linear-gradient(145deg, #0f766e 0%, #0b5a64 52%, #0f172a 100%);
}

.teacher-auth-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 42%),
    linear-gradient(0deg, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0.16));
  pointer-events: none;
}

.teacher-auth-hero > * {
  position: relative;
  z-index: 1;
}

.teacher-auth-logo {
  width: 168px;
  filter: drop-shadow(0 16px 34px rgba(15, 23, 42, 0.22));
}

.teacher-auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.teacher-auth-title {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.teacher-auth-copy {
  max-width: 460px;
  margin: 14px 0 0;
  color: rgba(236, 254, 255, 0.86);
  font-size: 15px;
  line-height: 1.6;
}

.teacher-auth-highlights {
  display: grid;
  gap: 12px;
}

.teacher-auth-highlight {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
}

.teacher-auth-highlight strong,
.teacher-auth-highlight span {
  display: block;
}

.teacher-auth-highlight strong {
  font-size: 13px;
  font-weight: 800;
}

.teacher-auth-highlight span {
  margin-top: 2px;
  color: rgba(236, 254, 255, 0.74);
  font-size: 13px;
  line-height: 1.45;
}

.teacher-auth-dot {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 999px;
  background: #a7f3d0;
  box-shadow: 0 0 0 6px rgba(167, 243, 208, 0.14);
  flex: 0 0 12px;
}

.teacher-auth-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 36px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #ffffff);
}

.teacher-auth-panel .teacher-logo {
  width: 112px;
  margin: 0;
}

.teacher-auth-panel .teacher-auth-card h1,
.teacher-auth-panel h1 {
  margin: 0;
}

.teacher-auth-panel .teacher-page-subtitle {
  font-size: 14px;
  line-height: 1.55;
}

.teacher-auth-panel .teacher-button {
  width: 100%;
}

.teacher-auth-footer {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.teacher-logo {
  width: 124px;
  margin: 0 auto 18px;
}

.teacher-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.12);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.teacher-auth-card h1,
.teacher-page-title {
  margin: 14px 0 8px;
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
}

.teacher-auth-card p,
.teacher-page-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.teacher-branch-select-card h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: normal;
  color: #ffffff;
}

.teacher-branch-select-card p {
  color: rgba(255, 255, 255, 0.68);
}

.teacher-branch-select-card .teacher-label {
  color: #ffffff;
}

.teacher-branch-select-card .teacher-select {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.96);
}

.teacher-branch-select-card .teacher-secondary-button {
  border-color: rgba(255, 255, 255, 0.72);
  background: transparent;
  color: #ffffff;
}

.teacher-branch-select-card .teacher-secondary-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.teacher-branch-select-card .teacher-actions {
  display: grid;
  gap: 10px;
}

.teacher-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.teacher-label {
  display: block;
  color: #334155;
  font-weight: 700;
  font-size: 13px;
  margin: 0 0 6px;
}

.teacher-input,
.teacher-select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.teacher-input:focus,
.teacher-select:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 0.25rem var(--focus);
}

.teacher-input::placeholder {
  color: #94a3b8;
}

.teacher-button,
.teacher-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  min-height: 46px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition:
    filter 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.teacher-button {
  border: 1px solid rgba(20, 122, 103, 0.3);
  background: linear-gradient(180deg, #18a38c, #0f766e);
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.18);
}

.teacher-button:hover {
  filter: brightness(1.03);
}

.teacher-button:active,
.teacher-secondary-button:active,
.teacher-link-button:active {
  transform: translateY(1px);
}

.teacher-secondary-button,
.teacher-link-button {
  border: 1px solid var(--border);
  background: #fff;
  color: #334155;
  box-shadow: none;
}

.teacher-secondary-button:hover,
.teacher-link-button:hover {
  background: #f8fafc;
}

.teacher-chip,
.teacher-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.teacher-chip {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.16);
  color: var(--color-primary);
}

.teacher-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.teacher-card.teacher-login-surface {
  position: relative;
  border: 1px solid rgba(102, 192, 124, 0.25);
  background:
    radial-gradient(520px 320px at 15% 18%, rgba(255, 255, 255, 0.12), transparent 60%),
    radial-gradient(460px 300px at 85% 12%, rgba(102, 192, 124, 0.2), transparent 62%),
    linear-gradient(180deg, rgba(12, 45, 32, 0.92), rgba(8, 30, 21, 0.92));
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(102, 192, 124, 0.08);
}

.teacher-card.teacher-login-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 42%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.12));
  pointer-events: none;
}

.teacher-card.teacher-login-surface > * {
  position: relative;
  z-index: 1;
}

.teacher-card.teacher-login-surface .teacher-eyebrow {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(102, 192, 124, 0.16);
  color: rgba(255, 255, 255, 0.6);
}

.teacher-card.teacher-login-surface .teacher-page-title {
  color: #ffffff;
}

.teacher-card.teacher-login-surface .teacher-page-subtitle {
  color: rgba(255, 255, 255, 0.72);
}

.teacher-card.teacher-login-surface .teacher-chip,
.teacher-card.teacher-login-surface .teacher-link-button {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(102, 192, 124, 0.16);
  color: #ffffff;
}

.teacher-card.teacher-login-surface .teacher-link-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.teacher-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 22px;
}

.teacher-header-right {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.teacher-grid {
  display: grid;
  gap: 16px;
}

.teacher-grid.courses {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.teacher-panel {
  padding: 18px;
}

.teacher-course-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 1));
  box-shadow: 0 4px 14px rgba(16, 24, 16, 0.05);
}

.teacher-course-card h2,
.teacher-section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #334155;
}

.teacher-course-meta,
.teacher-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.teacher-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  background: rgba(15, 118, 110, 0.08);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 800;
}

.teacher-notice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.12);
}

.teacher-notice::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: #0f766e;
  box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.12);
  flex: 0 0 10px;
}

.teacher-notice.success {
  border-color: rgba(22, 163, 74, 0.24);
  background: rgba(22, 163, 74, 0.08);
  color: #166534;
}

.teacher-notice.success::before {
  background: #16a34a;
  box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.12);
}

.teacher-notice.error {
  border-color: rgba(220, 38, 38, 0.24);
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
}

.teacher-notice.error::before {
  background: #dc2626;
  box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.12);
}

.teacher-empty {
  padding: 20px;
  border-radius: var(--radius);
  border: 1px dashed #cbd5e1;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.95));
  color: var(--muted);
}

.teacher-attendance-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 330px) minmax(0, 1fr);
}

.teacher-students {
  display: grid;
  gap: 12px;
}

.teacher-student-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 4px 14px rgba(16, 24, 16, 0.05);
}

.teacher-student-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.teacher-student-name {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.teacher-student-data {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.teacher-attendance-toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.teacher-absence-reason {
  display: none;
  gap: 6px;
}

.teacher-absence-reason.is-visible {
  display: grid;
}

.teacher-attendance-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.teacher-attendance-option {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.teacher-attendance-option:hover {
  background: #f8fafc;
}

.teacher-attendance-option.present.is-selected {
  color: #166534;
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.24);
}

.teacher-attendance-option.absent.is-selected {
  color: #991b1b;
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.22);
}

.teacher-attendance-option.pending.is-selected {
  color: #92400e;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.26);
}

.teacher-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.teacher-toolbar button {
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 14px;
}

*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .teacher-shell {
    width: calc(100% - 20px);
    padding-top: 10px;
  }

  .teacher-header,
  .teacher-attendance-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .teacher-header-right {
    justify-content: flex-start;
  }

  .teacher-auth-layout {
    grid-template-columns: 1fr;
  }

  .teacher-auth-hero,
  .teacher-auth-panel {
    padding: 28px;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 15px;
  }

  .teacher-auth-wrap {
    padding: 16px;
  }

  .teacher-auth-card,
  .teacher-card {
    border-radius: 14px;
  }

  .teacher-auth-card {
    padding: 22px 18px;
  }

  .teacher-auth-card.teacher-branch-select-card {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .teacher-auth-card.is-login {
    padding: 0;
  }

  .teacher-auth-hero,
  .teacher-auth-panel {
    padding: 22px 18px;
  }

  .teacher-auth-title {
    font-size: 2.3rem;
  }

  .teacher-header,
  .teacher-panel,
  .teacher-course-card,
  .teacher-student-card {
    padding: 16px;
  }

  .teacher-chip,
  .teacher-link-button,
  .teacher-button,
  .teacher-secondary-button {
    width: 100%;
  }

  .teacher-attendance-toggle {
    grid-template-columns: 1fr;
  }

  .teacher-actions {
    flex-direction: column;
  }

  .teacher-input,
  .teacher-select {
    font-size: 16px;
  }
}
