/**
 * Auth pages – layout matching a1.php
 */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --banner-height: clamp(280px, 58vw, 400px);
  --banner-radius: clamp(24px, 6vw, 50px);
  --accent: #4300ff;
  --accent-dark: #0b00ff;
  --input-max: 22rem;
  --page-pad: clamp(1rem, 4vw, 1.5rem);
  --link-color: #5d18be;
  --link-muted: #888;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  background-color: #f4f4f8;
  color: #1a1a2e;
  min-height: 100dvh;
}

.auth-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.banner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: var(--banner-height);
  overflow: hidden;
  background-image:
    linear-gradient(rgb(67 0 255 / 62%), rgb(11 0 255 / 62%)),
    url(/order/photo/bear.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 0 0 var(--banner-radius) var(--banner-radius);
}

.banner__shine {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  pointer-events: none;
}

.menu {
  position: absolute;
  top: var(--page-pad);
  right: var(--page-pad);
  z-index: 2;
}

.menu a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.25rem;
  text-decoration: none;
  color: #fff;
  background: rgb(0 0 0 / 25%);
  border-radius: 50%;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease;
}

.menu a:hover,
.menu a:focus-visible {
  background: rgb(0 0 0 / 40%);
  outline: none;
}

.banner-welcome {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: min(92%, 16rem);
  padding-bottom: clamp(0.75rem, 3vw, 1.25rem);
  text-align: center;
  pointer-events: none;
}

.banner-welcome__title {
  font-size: clamp(1.35rem, 5.5vw, 1.85rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  text-shadow: 0 2px 12px rgb(0 0 0 / 35%);
  line-height: 1.2;
  margin: 0;
}

.banner-welcome__avatar {
  flex-shrink: 0;
  width: clamp(4.5rem, 20vw, 6rem);
  height: clamp(4.5rem, 20vw, 6rem);
  padding: clamp(0.85rem, 3.5vw, 1.1rem);
  background: #fff;
  border-radius: 50%;
  box-shadow:
    0 4px 16px rgb(0 0 0 / 15%),
    0 0 0 4px rgb(255 255 255 / 25%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-welcome__avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.login-form {
  padding: clamp(1.25rem, 5vw, 2rem) var(--page-pad) 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  max-width: var(--input-max);
  margin-inline: auto;
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 30px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  border: groove 2px #5d18be;
}

.field input::placeholder {
  color: #999;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(67 0 255 / 18%);
}

.field-password {
  position: relative;
}

.field-password input {
  padding-left: 2.75rem;
}

.field-password__toggle {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  padding: 4px;
  font-size: 1rem;
  line-height: 1;
}

.field-password__toggle:hover {
  color: #5d18be;
}

.field-hint {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.15rem;
}

.field--checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: var(--input-max);
}

.field--checkbox input[type="checkbox"] {
  width: auto;
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--link-color);
}

.field--checkbox label {
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}

.field--checkbox a {
  color: var(--link-color);
  text-decoration: none;
}

.field--checkbox a:hover {
  text-decoration: underline;
}

.auth-remember {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  max-width: var(--input-max);
  margin-inline: auto;
  font-size: 0.875rem;
}

.auth-remember label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-weight: 500;
  color: #333;
}

.auth-remember input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--link-color);
}

.auth-forgot {
  color: var(--link-muted);
  text-decoration: none;
  font-weight: 600;
}

.auth-forgot:hover {
  color: var(--link-color);
}

.submit-wrap {
  width: 100%;
  max-width: var(--input-max);
  margin-inline: auto;
  margin-top: 0.5rem;
}

.btn-login {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #ff9201, #ff9201);
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease, background 0.2s ease;
}

.btn-login:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, rgb(35, 1, 255), rgb(145, 1, 255));
}

.btn-login:active {
  transform: scale(0.98);
}

.btn-login:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-login:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.auth-alert {
  width: 100%;
  max-width: var(--input-max);
  margin-inline: auto;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-alert--error {
  background: #fff0f0;
  border: 1px solid #ffd0d0;
  color: #b91c1c;
}

.auth-alert--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.auth-links {
  text-align: center;
  margin-top: 0.35rem;
  font-size: 14px;
  font-weight: 600;
}

.auth-links a {
  text-decoration: none;
  color: var(--link-color);
  transition: color 0.2s ease;
}

.auth-links a:hover {
  color: #3d0a86;
}

.auth-links--muted a {
  color: var(--link-muted);
  font-weight: 500;
}

.auth-links--muted a:hover {
  color: var(--link-color);
}

.auth-links--store {
  margin-top: 0.75rem;
}

.auth-links--store a {
  font-weight: 700;
}

.password-strength {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.35rem;
}

.password-strength-bar {
  height: 100%;
  transition: width 0.2s ease, background 0.2s ease;
  border-radius: 2px;
}

.strength-weak { background: #ef4444; width: 25%; }
.strength-fair { background: #f59e0b; width: 50%; }
.strength-good { background: #10b981; width: 75%; }
.strength-strong { background: #059669; width: 100%; }

@media (min-width: 480px) {
  .auth-container {
    box-shadow: 0 4px 24px rgb(0 0 0 / 8%);
    background: #fff;
    border-radius: 0 0 1rem 1rem;
  }
}

@media (max-width: 359px) {
  .menu a {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.1rem;
  }
}

/* تم تاریک — هماهنگ با order_theme در بقیهٔ سایت */
[data-theme="dark"] body {
  background-color: #0f1117;
  color: #e5e7eb;
}

[data-theme="dark"] .login-form label {
  color: #d1d5db;
}

[data-theme="dark"] .login-form input {
  background: #1a1d24;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f3f4f6;
}

[data-theme="dark"] .login-form input::placeholder {
  color: #6b7280;
}

[data-theme="dark"] .field-password__toggle {
  color: #9ca3af;
}

[data-theme="dark"] .auth-remember label,
[data-theme="dark"] .auth-forgot {
  color: #9ca3af;
}

[data-theme="dark"] .auth-links a {
  color: #a5b4fc;
}

[data-theme="dark"] .auth-links--muted a {
  color: #9ca3af;
}

[data-theme="dark"] .auth-alert--error {
  background: rgba(220, 53, 69, 0.15);
  color: #fca5a5;
}

[data-theme="dark"] .auth-alert--success {
  background: rgba(40, 167, 69, 0.15);
  color: #86efac;
}

[data-theme="dark"] .field-hint {
  color: #9ca3af;
}

[data-theme="dark"] .password-strength {
  background: #374151;
}

@media (min-width: 480px) {
  [data-theme="dark"] .auth-container {
    background: #1a1d24;
    box-shadow: 0 4px 24px rgb(0 0 0 / 35%);
  }
}
