﻿:root {
  --bg-1: #edf2ff;
  --bg-2: #dae7ff;
  --bg-3: #f5f8ff;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-soft: #f4f8ff;
  --text: #12233d;
  --muted: #5f6e84;
  --line: rgba(22, 42, 70, 0.17);
  --brand: #0f9a87;
  --brand-strong: #0b7566;
  --brand-soft: rgba(15, 154, 135, 0.16);
  --danger: #ce4a68;
  --shadow: 0 26px 70px rgba(20, 38, 65, 0.16);
}

html[data-theme="dark"] {
  --bg-1: #091524;
  --bg-2: #132238;
  --bg-3: #0f1c31;
  --surface: rgba(14, 27, 46, 0.9);
  --surface-solid: #0d1a2d;
  --surface-soft: #102038;
  --text: #e8f1ff;
  --muted: #9fb1cc;
  --line: rgba(228, 238, 255, 0.2);
  --brand: #2bc8af;
  --brand-strong: #1b9b86;
  --brand-soft: rgba(43, 200, 175, 0.2);
  --danger: #f47a99;
  --shadow: 0 28px 74px rgba(2, 8, 19, 0.56);
}

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

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(79, 145, 255, 0.24), transparent 34%),
    radial-gradient(circle at 90% 9%, rgba(15, 154, 135, 0.2), transparent 36%),
    linear-gradient(150deg, var(--bg-1) 0%, var(--bg-2) 52%, var(--bg-3) 100%);
}

.auth2-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 30px);
}

.auth2-card {
  width: min(540px, 100%);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 90% 6%, rgba(15, 154, 135, 0.1), transparent 38%),
    radial-gradient(circle at 8% 95%, rgba(74, 132, 255, 0.11), transparent 44%),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  padding: clamp(22px, 4.2vw, 34px);
}

.auth2-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth2-back {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
}

.auth2-back:hover {
  color: var(--text);
}

.auth2-mode {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-solid);
  color: var(--text);
  min-height: 40px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.auth2-head {
  margin-top: 18px;
}

.auth2-kicker {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand), transparent 62%);
  background: var(--brand-soft);
  color: var(--brand-strong);
  padding: 7px 12px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-weight: 700;
}

.auth2-head h1 {
  margin-top: 13px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4.8vw, 2.7rem);
  line-height: 1.06;
  letter-spacing: -0.6px;
}

.auth2-head p:last-child {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.72;
  font-size: 0.93rem;
  max-width: 46ch;
}

.auth2-alert {
  margin-top: 14px;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.86rem;
  line-height: 1.6;
}

.auth2-alert.success {
  border: 1px solid color-mix(in srgb, var(--brand), transparent 58%);
  background: color-mix(in srgb, var(--surface), var(--brand-soft) 24%);
  color: var(--brand-strong);
}

.auth2-alert.danger {
  border: 1px solid color-mix(in srgb, var(--danger), transparent 54%);
  background: color-mix(in srgb, var(--surface), #ffe5eb 28%);
  color: color-mix(in srgb, var(--danger), #64172a 28%);
  display: grid;
  gap: 4px;
}

.auth2-form {
  margin-top: 18px;
  display: grid;
  gap: 11px;
}

.auth2-form label {
  display: inline-block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.auth2-form input,
.auth2-password-btn,
.auth2-submit {
  font: inherit;
}

.auth2-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
  color: var(--text);
  min-height: 44px;
  padding: 11px 12px;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth2-form input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--brand), transparent 40%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand), transparent 86%);
}

.auth2-password-wrap {
  position: relative;
}

.auth2-password-wrap input {
  padding-right: 82px;
}

.auth2-password-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  min-height: 30px;
  padding: 4px 10px;
  cursor: pointer;
}

.auth2-submit {
  margin-top: 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(128deg, var(--brand), var(--brand-strong));
  min-height: 46px;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.auth2-hint {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.6;
}

html[data-theme="dark"] .auth2-card,
html[data-theme="dark"] .auth2-form input,
html[data-theme="dark"] .auth2-password-btn,
html[data-theme="dark"] .auth2-mode {
  background: var(--surface-solid);
  border-color: var(--line);
}

html[data-theme="dark"] .auth2-alert.danger {
  color: #ffd0dd;
  background: color-mix(in srgb, var(--surface), #5d2233 28%);
}

html[data-theme="dark"] .auth2-form input::placeholder {
  color: #8296b6;
}

html[data-theme="dark"] .auth2-kicker {
  color: #9bfbe8;
}

@media (max-width: 640px) {
  .auth2-card {
    border-radius: 20px;
    padding: 20px 16px;
  }

  .auth2-top {
    flex-direction: column;
    align-items: stretch;
  }

  .auth2-mode,
  .auth2-submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
