/* ===== Design tokens (mirrors the Tailwind theme) ===== */
:root {
  --teal-900: #0f2626;
  --teal-800: #1a3535;
  --coral: #f49687;
  --primary: #D64B36;
  --primary-foreground: #ffffff;
  --card: #ffffff;
  --muted: #f1f5f4;
  --muted-foreground: #6b7a78;
  --border: #e2e8e6;
  --foreground: #1a2b2b;
  --destructive: #c0392b;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  color: var(--foreground);
  background: var(--teal-900);
  -webkit-font-smoothing: antialiased;
}

.page {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--teal-900);
}

/* ===== Background slider ===== */
.bg-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.bg-slider .slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1);
  transition: opacity 1.4s ease, transform 1.4s ease;
}

.bg-slider .slide.active {
  opacity: 1;
  transform: scale(1.05);
}

.bg-overlay-dark {
  position: absolute;
  inset: 0;
  background: rgba(15, 38, 38, 0.35);
}

.bg-overlay-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
      rgba(15, 38, 38, 1) 0%,
      rgba(15, 38, 38, 0.55) 50%,
      rgba(15, 38, 38, 0.15) 100%);
}

/* ===== Content shell ===== */
.shell {
  position: relative;
  z-index: 10;
  max-width: 1240px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

@media (min-width: 640px) {
  .shell {
    padding: 24px 40px;
  }
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  height: 40px;
  width: auto;
}

@media (min-width: 640px) {
  .logo img {
    height: 44px;
  }
}

/* ===== Language Dropdown Menu ===== */
.lang {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.lang-btn svg {
  width: 14px;
  height: 14px;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.18);
  min-width: 140px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
}

[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
}

.lang-menu.show {
  display: flex;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal-800);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background 0.2s;
  width: 100%;
  text-align: left;
}

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

.lang-option:hover {
  background: var(--muted);
}

.lang-option .check {
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
}

/* ===== Two-column layout ===== */
.grid {
  flex: 1;
  display: grid;
  gap: 40px;
  align-items: center;
  padding: 32px 0;
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: 1.05fr minmax(0, 430px);
    gap: 64px;
  }
}

/* story side */
.story {
  display: none;
}

@media (min-width: 1024px) {
  .story {
    display: block;
  }
}

.badge {
  display: inline-flex;
  background: var(--coral);
  color: var(--teal-800);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.story h2 {
  margin-top: 20px;
  max-width: 18ch;
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--primary-foreground);
}

.story p {
  margin-top: 20px;
  max-width: 46ch;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
}

.stats {
  margin-top: 36px;
  display: flex;
  gap: 40px;
}

.stat .v {
  font-size: 24px;
  font-weight: 800;
  color: var(--coral);
}

.stat .l {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.6);
}

.dots {
  margin-top: 40px;
  display: flex;
  gap: 8px;
}

.dots button {
  height: 6px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.35);
  width: 16px;
}

.dots button.active {
  width: 40px;
  background: var(--coral);
}

/* ===== Glass auth card ===== */
.card {
  width: 100%;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.card.hidden {
  display: none !important;
}

@media (min-width: 640px) {
  .card {
    padding: 32px;
  }
}

.card h1 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--teal-800);
}

.card .sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted-foreground);
}

/* role pills */
.roles {
  margin-top: 20px;
  display: flex;
  background: var(--muted);
  border-radius: 999px;
  padding: 4px;
}

.roles button {
  flex: 1;
  white-space: nowrap;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s;
}

.roles button.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.roles button:hover:not(.active) {
  color: var(--foreground);
}

/* form */
form {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--teal-800);
  display: block;
}

.field input {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 16px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--foreground);
  outline: none;
  transition: all 0.2s;
}

.field input::placeholder {
  color: rgba(107, 122, 120, 0.55);
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(214, 75, 54, 0.18);
}

/* ===== Form Validation Error Styles ===== */
.field.invalid input {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(214, 75, 54, 0.15) !important;
}

.field .error-msg {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  display: none;
}

.field.invalid .error-msg {
  display: block;
}

.pw-wrap {
  position: relative;
}

.pw-wrap input {
  padding-right: 90px;
}

[dir="rtl"] .pw-wrap input {
  padding-right: 16px;
  padding-left: 90px;
}

.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  cursor: pointer;
}

[dir="rtl"] .pw-toggle {
  right: auto;
  left: 12px;
}

.pw-toggle:hover {
  background: rgba(214, 75, 54, 0.1);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  cursor: pointer;
}

.row label input[type="checkbox"] {
  accent-color: var(--primary);
}

.row a {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.row a:hover {
  text-decoration: underline;
}

.submit {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
  transition: opacity 0.2s;
}

.submit:hover {
  opacity: 0.9;
}

.submit .arrow {
  transition: transform 0.2s;
}

.submit:hover .arrow {
  transform: translateX(4px);
}

.help {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted-foreground);
}

.help a {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.help a:hover {
  text-decoration: underline;
}

.go-back-wrap {
  margin-top: 18px;
  text-align: left;
}

[dir="rtl"] .go-back-wrap {
  text-align: right;
}

.go-back-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal-800);
  text-decoration: underline;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
  transition: color 0.2s;
}

.go-back-link:hover {
  color: var(--primary);
}

footer {
  flex-shrink: 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

/* RTL */
[dir="rtl"] .submit .arrow {
  transform: rotate(180deg);
}