@import url('design-system.css');

/* ================================================================
   Povion — Auth (login / register / password reset)
   ================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── BODY ─────────────────────────────────────────────────────── */
body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--navy);
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
}

/* фоновая сетка */
body::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 25% 30%, rgba(47,111,237,.15) 0%, transparent 45%),
    radial-gradient(circle at 75% 70%, rgba(242,177,61,.1) 0%, transparent 45%),
    repeating-linear-gradient(90deg, transparent, transparent 58px, rgba(255,255,255,.02) 58px, rgba(255,255,255,.02) 60px);
  pointer-events: none;
}

/* ── WRAPPER ─────────────────────────────────────────────────── */
.wrapper {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  padding: var(--space-8) var(--space-6);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  position: relative;
  z-index: 1;
  animation: authFade .4s var(--ease);
}

@keyframes authFade {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* декоративная полоска сверху */
.wrapper::before {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ── FORM TITLE ──────────────────────────────────────────────── */
.wrapper h1 {
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  margin-bottom: var(--space-6);
  color: var(--ink);
  letter-spacing: -.02em;
}
.wrapper h1 span { color: var(--brand); }

/* ── INPUTS ───────────────────────────────────────────────────── */
.input-box { margin-bottom: var(--space-4); }

.input-box input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  font-size: 15px;
  outline: none;
  background: var(--surface-2);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.input-box input::placeholder { color: var(--ink-3); }

.input-box input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,111,237,.12);
  background: var(--surface);
}

/* password toggle */
.input-box--password { position: relative; }
.input-box--password input { padding-right: 50px; }

.password-toggle {
  position: absolute;
  right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  color: var(--ink-3);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.password-toggle:hover {
  background: var(--surface-hover);
  color: var(--brand);
}

/* ── REMEMBER / FORGOT ───────────────────────────────────────── */
.remember {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-5);
  font-size: 13px;
}
.remember label {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; color: var(--ink-2);
}
.remember input[type="checkbox"] {
  accent-color: var(--brand);
  width: 16px; height: 16px;
  cursor: pointer;
}
.remember a {
  color: var(--brand);
  font-weight: 500;
  transition: color var(--dur) var(--ease);
}
.remember a:hover { color: var(--brand-2); }

/* ── SUBMIT BUTTON ───────────────────────────────────────────── */
.btn {
  width: 100%;
  padding: 15px;
  background: var(--brand);
  color: #fff; border: none;
  border-radius: var(--radius-md);
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover {
  background: var(--brand-2);
  box-shadow: 0 6px 20px rgba(47,111,237,.3);
}
.btn:active { transform: scale(.97); }
.btn:disabled {
  background: var(--ink-3);
  cursor: not-allowed;
  box-shadow: none;
}

/* ── REGISTER LINK ───────────────────────────────────────────── */
.register-link {
  text-align: center;
  margin-top: var(--space-5);
  font-size: 14px;
  color: var(--ink-2);
}
.register-link a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
.register-link a:hover { color: var(--brand-2); }

/* ── RESET MODAL ─────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  z-index: 1000;
}
.modal.active { display: flex; }

.modal-content {
  background: var(--surface);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  width: 90%; max-width: 400px;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: modalFade .25s var(--ease);
}
.modal-content .modal__close {
  position: absolute; top: 12px; right: 12px;
  background: var(--surface-hover); border: none;
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  font-size: 18px; color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.modal-content .modal__close:hover { color: var(--ink); }

.modal-content h3 {
  font-size: 18px; font-weight: 700;
  text-align: center; margin-bottom: var(--space-4);
  color: var(--ink);
}
.modal-content input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  font-size: 15px;
  margin-bottom: var(--space-3);
  outline: none;
  background: var(--surface-2);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.modal-content input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,111,237,.12);
  background: var(--surface);
}
.modal-content input[text-align="center"] {
  text-align: center;
  letter-spacing: 5px;
  font-size: 20px;
}

.modal-content button {
  width: 100%;
  padding: 12px;
  background: var(--brand);
  color: #fff; border: none;
  border-radius: var(--radius-md);
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.modal-content button:hover { background: var(--brand-2); }
.modal-content button:active { transform: scale(.97); }

.modal-content button.green {
  background: var(--ok);
}
.modal-content button.green:hover {
  background: #0f7d58;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .wrapper {
    padding: var(--space-6) var(--space-5);
    border-radius: var(--radius-lg);
  }
  .wrapper h1 { font-size: 22px; }
}
