@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  --auth-bg:
    radial-gradient(circle at 12% -8%, rgba(18, 217, 253, 0.12), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(12, 36, 64, 0.45), transparent 65%),
    linear-gradient(170deg, #0a1020 0%, #08101b 45%, #05080f 100%);
  --auth-panel: #0d1626;
  --auth-border: rgba(110, 160, 188, 0.28);
  --auth-text: #e7f2ff;
  --auth-muted: #9fb7cf;
  --auth-accent: #12d9fd;
  --auth-accent-rgb: 18, 217, 253;
  --auth-shadow: 0 18px 48px rgba(4, 9, 20, 0.55);
  --auth-input-bg: rgba(5, 8, 15, 0.82);
  --auth-focus: 0 0 0 2px rgba(var(--auth-accent-rgb), 0.28);
}

html[data-theme="light"] {
  --auth-bg:
    radial-gradient(circle at 12% -8%, rgba(15, 184, 211, 0.22), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(114, 182, 214, 0.26), transparent 55%),
    linear-gradient(160deg, #cfddee, #d9e6f4 52%, #e2ebf7);
  --auth-panel: #d7e3ef;
  --auth-border: rgba(12, 149, 178, 0.38);
  --auth-text: #0a1b28;
  --auth-muted: #324a64;
  --auth-accent: #0d9bb8;
  --auth-accent-rgb: 13, 155, 184;
  --auth-input-bg: rgba(218, 230, 242, 0.92);
  --auth-shadow: 0 18px 48px rgba(12, 66, 98, 0.22);
  --auth-focus: 0 0 0 2px rgba(var(--auth-accent-rgb), 0.4);
}

.auth-page {
  font-family: Vazirmatn, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 12px;
  margin: 0;
  background: var(--auth-bg);
  color: var(--auth-text);
}

.auth-card {
  width: min(480px, 96vw);
  background: var(--auth-panel);
  border: 1px solid var(--auth-border);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--auth-shadow);
  position: relative;
}

.auth-title {
  margin: 0 0 8px 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--auth-text);
  text-align: center;
}

.auth-subtitle {
  margin: 0 0 20px 0;
  color: var(--auth-muted);
  text-align: center;
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--auth-text);
}

.auth-field input,
.auth-field select {
  width: 95%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--auth-border);
  background: var(--auth-input-bg);
  color: var(--auth-text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.input-with-icon {
  position: relative;
  
}

.password-toggle {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 0;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--auth-muted);
}

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

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.password-toggle .eye-open,
.password-toggle .eye-closed {
  display: none;
}

.password-toggle[data-visible="true"] .eye-open {
  display: block;
}

.password-toggle[data-visible="true"] .eye-closed {
  display: none;
}

.password-toggle[data-visible="false"] .eye-open {
  display: none;
}

.password-toggle[data-visible="false"] .eye-closed {
  display: block;
}

.auth-button {
  padding: 14px 0;
  border: none;
  border-radius: 12px;
  background: var(--auth-accent);
  color: #050609;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.auth-button:hover {
  transform: translateY(-1px);
}

.auth-error,
.auth-success {
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}

.auth-error {
  color: #f87171;
}

.auth-success {
  color: var(--auth-accent);
}

.auth-helper {
  margin-top: 18px;
  text-align: center;
  color: var(--auth-muted);
}

.auth-helper a {
  color: var(--auth-accent);
  font-weight: 600;
}

.auth-helper.subtle {
  margin-top: 4px;
  text-align: right;
  direction: rtl;
  color: var(--auth-muted);
}

.auth-hint {
  margin-top: -4px;
  color: var(--auth-muted);
  font-size: 0.9rem;
}

.auth-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--auth-border);
  border-radius: 12px;
  background: rgba(46, 196, 182, 0.05);
  color: var(--auth-text);
  margin: 10px 0 4px 0;
}

.pill-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ghost-link {
  border: none;
  background: transparent;
  color: var(--auth-accent);
  cursor: pointer;
  font-weight: 700;
  padding: 6px 0;
}

.inline-form {
  margin: 0;
}

.full-width-link {
  display: inline-block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  padding: 12px 0;
  border-radius: 12px;
  background: var(--auth-accent);
  color: #050609;
  font-weight: 800;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.theme-toggle {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(var(--auth-accent-rgb), 0.45);
  background: radial-gradient(circle at 30% 30%, var(--auth-accent), #50e7ff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.theme-toggle::before,
.theme-toggle::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.theme-toggle::before {
  width: 18px;
  height: 18px;
  background: #050609;
  box-shadow: 0 0 0 2px rgba(5, 6, 9, 0.4);
  transform: translateX(6px);
  opacity: 0;
}

.theme-toggle::after {
  width: 14px;
  height: 14px;
  background: #f7fcff;
  box-shadow: 0 0 0 2px rgba(247, 252, 255, 0.55);
}

.theme-toggle[data-state="light"] {
  background: radial-gradient(circle at 70% 30%, rgba(var(--auth-accent-rgb), 0.2), rgba(231, 245, 255, 0.4));
  border-color: rgba(var(--auth-accent-rgb), 0.35);
}

.theme-toggle[data-state="light"]::before {
  opacity: 1;
  transform: translateX(-4px);
}

.theme-toggle[data-state="light"]::after {
  opacity: 0;
}

@media (max-width: 520px) {
  .auth-card {
    padding: 24px;
  }

  .auth-page {
    padding: 24px 12px;
  }
}
