:root {
  --bg: #f6f9fc;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-soft: #f7fbff;
  --text: #0a2540;
  --text-soft: #425466;
  --text-muted: #6b7c93;
  --border-soft: rgba(10, 37, 64, 0.08);
  --primary: #0f8b8d;
  --primary-deep: #001a2e;
  --accent: #635bff;
  --field-bg: #ffffff;
  --field-border: #d8e1ea;
  --field-focus: rgba(99, 91, 255, 0.18);
  --field-error: #d1435b;
  --shadow-sm: 0 6px 16px rgba(10, 37, 64, 0.06);
  --shadow-lg: 0 28px 70px rgba(10, 37, 64, 0.12);
  --radius-card: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body.auth-page {
  padding-top: 0;
}

a {
  color: inherit;
}

.page-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(10, 37, 64, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 37, 64, 0.035) 1px, transparent 1px);
  background-size: 88px 88px;
  opacity: 0.42;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.18;
}

.bg-orb--left {
  width: 360px;
  height: 360px;
  left: -110px;
  top: 120px;
  background: #7dd3fc;
}

.bg-orb--right {
  width: 400px;
  height: 400px;
  right: -120px;
  bottom: 20px;
  background: #93c5fd;
}

.bg-beam {
  position: absolute;
  width: 55vw;
  height: 280px;
  left: 20%;
  top: -120px;
  background: linear-gradient(180deg, rgba(15, 139, 141, 0.20), rgba(15, 139, 141, 0));
  filter: blur(40px);
  transform: rotate(-4deg);
}

.auth-main {
  position: relative;
  z-index: 2;
  width: min(100%, calc(100% - 24px));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0;
}

.auth-shell {
  width: min(100%, 520px);
}

.auth-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.auth-card--centered {
  width: 100%;
}

.auth-card__topbar {
  height: 8px;
  background: linear-gradient(90deg, #0f8b8d 0%, #1d9bf0 55%, #99f6e4 100%);
}

.auth-card__inner {
  padding: 32px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
}

.auth-logo img {
  height: 16px;
  width: auto;
}

.auth-card__header h2 {
  margin: 6px 0 0;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.auth-card__eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-card__header p {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 14px;
}

.auth-form {
  margin-top: 26px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label,
.form-row-head label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.form-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.form-group input:focus {
  border-color: rgba(99, 91, 255, 0.42);
  box-shadow: 0 0 0 4px var(--field-focus);
}

.password-wrap {
  position: relative;
}

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

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  min-width: 64px;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(99, 91, 255, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.auth-link {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 22px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-soft);
}

.check-row input {
  width: 16px;
  height: 16px;
}

.auth-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 139, 141, 0.10);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.btn {
  width: 100%;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #0f8b8d 0%, #086a7b 50%, #001a2e 100%);
  color: #ffffff;
  box-shadow: 0 18px 35px rgba(15, 139, 141, 0.22);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.btn-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}

.btn-spinner.is-visible {
  display: inline-block;
}

.field-error,
.form-status {
  min-height: 18px;
  margin-top: 8px;
  font-size: 12px;
}

.field-error {
  color: var(--field-error);
}

.form-status {
  margin-top: 14px;
  color: var(--text-soft);
}

.form-status.is-error {
  color: var(--field-error);
}

.form-status.is-success {
  color: var(--primary);
}

.auth-support {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(10, 37, 64, 0.08);
  text-align: center;
}

.auth-support p {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 13px;
}

.contact-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(10, 37, 64, 0.10);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #0a2540;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.contact-link-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 91, 255, 0.18);
  box-shadow: var(--shadow-sm);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .auth-main {
    width: min(100%, calc(100% - 24px));
  }

  .auth-card__inner {
    padding: 24px 20px;
  }

  .auth-options {
    flex-direction: column;
    align-items: flex-start;
  }
}
