:root {
  --bg: #12171d;
  --bg-strong: #1a222b;
  --panel: #1a2028;
  --panel-alt: #232b35;
  --card: #171e27;
  --line: rgba(214, 203, 188, 0.12);
  --primary: #78c58c;
  --primary-2: #32845b;
  --accent: #e5d5ba;
  --text: #f5efe7;
  --muted: #c9c2b8;
  --success: #8fd19a;
  --danger: #df8f87;
  --shadow: 0 24px 60px rgba(5, 8, 12, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(215, 176, 138, 0.12), transparent 24%),
    radial-gradient(circle at bottom right, rgba(184, 131, 92, 0.14), transparent 28%),
    linear-gradient(135deg, var(--bg), var(--bg-strong));
}

html[dir="rtl"] body {
  direction: rtl;
}

html[dir="rtl"] .language-dropdown {
  right: auto;
  left: 0;
}

html[dir="rtl"] .lang-option {
  text-align: right;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.landing-body,
.auth-body,
.dashboard-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.landing-shell,
.auth-shell,
.dashboard-shell {
  width: min(1200px, 100%);
}

.topbar,
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  background: rgba(23, 30, 39, 0.9);
  border-radius: 22px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.language-menu {
  position: relative;
}

.language-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-weight: 700;
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 160px;
  display: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(20, 26, 33, 0.98);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 20;
}

.language-dropdown.is-open {
  display: block;
}

.language-dropdown form {
  display: grid;
}

.lang-option {
  width: 100%;
  border: 0;
  padding: 12px 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.lang-option:hover {
  background: rgba(120, 197, 140, 0.1);
}

.auth-language-menu {
  margin: 18px 0 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fffdf9;
  font-weight: 900;
  box-shadow: 0 10px 25px rgba(50, 132, 91, 0.28);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
}

.hero-panel {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 26px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(23, 30, 39, 0.9);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.hero-copy h1,
.profile-card h1,
.auth-card h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.05em;
  color: var(--text);
}

.hero-copy p,
.auth-card p,
.status-card p,
.feature-card p,
.profile-list li,
.info-note {
  color: var(--muted);
  line-height: 1.7;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 30px 0 24px;
}

.primary-button,
.secondary-button,
.ghost-button,
.action-button,
.styled-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.primary-button,
.action-button,
.styled-form button {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fffaf4;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(50, 132, 91, 0.24);
}

.secondary-button,
.ghost-button {
  background: rgba(120, 197, 140, 0.04);
  border-color: var(--line);
  color: var(--text);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.action-button:hover,
.styled-form button:hover {
  transform: translateY(-1px);
}

.hero-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.hero-meta li::before {
  content: "•";
  color: var(--primary);
  margin-right: 8px;
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(181, 124, 77, 0.10), rgba(255, 250, 244, 0.6));
  overflow: hidden;
}

.hero-visual::before,
.hero-visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(12px);
}

.hero-visual::before {
  width: 220px;
  height: 220px;
  background: rgba(181, 124, 77, 0.18);
  top: 40px;
  left: 40px;
}

.hero-visual::after {
  width: 180px;
  height: 180px;
  background: rgba(211, 160, 106, 0.2);
  right: 50px;
  bottom: 30px;
}

.mini-card {
  position: relative;
  z-index: 1;
  width: min(90%, 310px);
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.9);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.mini-card h3 {
  margin: 12px 0 6px;
  font-size: 1.6rem;
  color: var(--text);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stat-pill {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
}

.stat-pill strong {
  display: block;
  font-size: 1.2rem;
  margin-top: 6px;
  color: var(--text);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.feature-card,
.profile-card,
.status-card,
.auth-card {
  border: 1px solid var(--line);
  background: rgba(23, 30, 39, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.feature-card {
  padding: 24px 22px;
}

.feature-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  color: var(--text);
}

.feature-card .icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(181, 124, 77, 0.14), rgba(211, 160, 106, 0.15));
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.auth-shell {
  display: grid;
  place-items: center;
}

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

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-card h1 {
  font-size: clamp(2.1rem, 4vw, 2.8rem);
}

.styled-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.styled-form p {
  margin: 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.styled-form label {
  font-size: 0.9rem;
  color: var(--muted);
}

.styled-form input,
.styled-form select,
.styled-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.password-field,
.date-field {
  position: relative;
  width: 100%;
}

.password-field input,
.date-field input {
  padding-right: 52px;
}

.password-toggle,
.date-picker-button {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(120, 197, 140, 0.1);
  color: var(--primary);
  font-size: 0.9rem;
  line-height: 1;
}

.password-toggle:hover,
.password-toggle.is-visible,
.date-picker-button:hover {
  background: rgba(120, 197, 140, 0.2);
  color: var(--accent);
}

.styled-form input[type="date"] {
  color-scheme: dark;
  accent-color: var(--primary);
}

.styled-form input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.72;
  cursor: pointer;
  filter: sepia(0.15) saturate(1.4) hue-rotate(70deg);
}

html[dir="rtl"] .password-field input,
html[dir="rtl"] .date-field input {
  padding-right: 16px;
  padding-left: 52px;
}

html[dir="rtl"] .password-toggle,
html[dir="rtl"] .date-picker-button {
  right: auto;
  left: 10px;
}

.styled-form input:focus,
.styled-form select:focus,
.styled-form textarea:focus {
  border-color: rgba(120, 197, 140, 0.8);
  box-shadow: 0 0 0 4px rgba(120, 197, 140, 0.14);
}

.full-width {
  width: 100%;
  margin-top: 8px;
}

.inline-link {
  text-align: center;
  margin-top: 18px;
}

.inline-link a {
  color: var(--primary);
  font-weight: 700;
}

.dashboard-shell {
  display: grid;
  gap: 22px;
}

.profile-summary {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr;
  gap: 20px;
}

.profile-card,
.status-card {
  padding: 26px;
}

.profile-list {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
  display: grid;
  gap: 16px;
}

.profile-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.profile-list strong {
  color: var(--text);
}

.status-card h2 {
  margin: 0 0 10px;
  font-size: 2rem;
  color: var(--text);
}

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

.action-form {
  display: block;
}

.action-button {
  width: 100%;
  min-height: 62px;
  padding: 0 18px;
  border-radius: 16px;
  font-size: 1rem;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 22px;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--primary-2) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.attendance-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.attendance-table th,
.attendance-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.attendance-table th {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge.present {
  background: rgba(155, 197, 157, 0.15);
  color: var(--success);
}

.status-badge.absent {
  background: rgba(216, 134, 126, 0.12);
  color: var(--danger);
}

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

.small-button {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.85rem;
}

.powered-by {
  display: block;
  margin-top: 18px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .hero-panel,
  .profile-summary,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .dashboard-header {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .landing-body,
  .auth-body,
  .dashboard-body {
    align-items: flex-start;
    padding: 18px 14px;
  }

  .landing-shell,
  .auth-shell,
  .dashboard-shell {
    min-width: 0;
  }

  .topnav {
    width: 100%;
    justify-content: space-between;
    font-size: 0.9rem;
  }

  .topbar,
  .dashboard-header {
    align-items: stretch;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
  }

  .brand {
    min-width: 0;
    max-width: 100%;
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .brand span:last-child {
    overflow-wrap: anywhere;
  }

  .header-actions {
    width: 100%;
    gap: 10px;
  }

  .header-actions > form,
  .header-actions .primary-button {
    flex: 1 1 0;
    width: 100%;
  }

  .language-menu {
    flex: 0 0 112px;
  }

  .language-button {
    width: 100%;
    padding: 0 10px;
  }

  .dashboard-header > form,
  .dashboard-header > .ghost-button {
    flex: 1 1 0;
    width: 100%;
  }

  .dashboard-header > form button,
  .dashboard-header > .ghost-button {
    width: 100%;
  }

  .hero-panel,
  .auth-card,
  .profile-card,
  .status-card,
  .feature-card {
    border-radius: 18px;
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero-panel {
    gap: 18px;
    margin-top: 18px;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .hero-copy h1,
  .profile-card h1,
  .auth-card h1 {
    font-size: clamp(1.9rem, 9vw, 2.5rem);
    overflow-wrap: anywhere;
  }

  .hero-copy p,
  .auth-card p,
  .status-card p,
  .feature-card p {
    line-height: 1.55;
  }

  .auth-card,
  .profile-card,
  .status-card,
  .feature-card {
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .profile-summary {
    gap: 14px;
  }

  .profile-list {
    margin-top: 20px;
    gap: 12px;
  }

  .profile-list li {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .status-card h2 {
    font-size: 1.65rem;
  }

  .action-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .action-button {
    min-height: 54px;
  }

  .cta-row {
    flex-direction: column;
    width: 100%;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .action-button,
  .styled-form button {
    width: 100%;
  }

  .attendance-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .attendance-actions .primary-button,
  .attendance-actions .secondary-button,
  .attendance-actions .small-button {
    width: 100%;
  }

  .attendance-table th,
  .attendance-table td {
    padding: 12px 14px;
    white-space: nowrap;
  }

  .table-wrap {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-bottom: 6px;
  }

  .profile-card {
    min-width: 0;
    overflow: hidden;
  }

  .attendance-table {
    min-width: 620px;
  }

  .styled-form {
    gap: 13px;
    margin-top: 22px;
  }

  .styled-form input,
  .styled-form select,
  .styled-form textarea {
    min-height: 48px;
  }
}

.styled-form .password-toggle,
.styled-form .date-picker-button {
  width: 34px !important;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(120, 197, 140, 0.3);
  border-radius: 10px;
  background: #1b3829;
  color: var(--primary);
  box-shadow: none;
  font-size: 0.9rem;
  line-height: 1;
}

.styled-form .password-toggle:hover,
.styled-form .password-toggle.is-visible,
.styled-form .date-picker-button:hover {
  background: #28563c;
  color: var(--accent);
  transform: translateY(-50%);
}
