@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&family=Space+Grotesk:wght@500;700&display=swap");

:root {
  --bg: #0c1423;
  --panel: rgba(13, 24, 39, 0.86);
  --card: rgba(250, 252, 255, 0.96);
  --text-dark: #102136;
  --muted: #647992;
  --blue: #3f82f3;
  --blue-deep: #2458cf;
  --border: rgba(161, 187, 216, 0.32);
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.3);
  --font: "Manrope", "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background:
    radial-gradient(780px 320px at 8% 8%, rgba(63, 130, 243, 0.26), transparent 62%),
    radial-gradient(780px 300px at 92% 14%, rgba(56, 202, 161, 0.2), transparent 62%),
    linear-gradient(155deg, #09111f, #0d1b2f 62%, #0a1221);
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 0;
}

.auth-layout {
  width: min(1180px, 94vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(170, 200, 234, 0.24);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.auth-aside {
  display: flex;
  flex-direction: column;
  padding: clamp(26px, 4vw, 40px);
  color: #e9f2ff;
  background: var(--panel);
}

.aside-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: #f5f9ff;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.aside-brand__logo {
  width: 82px;
  height: 42px;
  flex: 0 0 auto;
  background: url("/static/css/OpenAVI_Black_Outline.png") center / contain no-repeat;
}

.aside-brand__text {
  line-height: 1;
}

.auth-aside h1 {
  margin: 20px 0 12px;
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.04;
  font-family: var(--font-display);
}

.auth-aside p {
  margin: 0;
  color: rgba(222, 235, 252, 0.86);
  line-height: 1.58;
}

.auth-aside ul {
  margin: 20px 0 0;
  padding-left: 18px;
  color: rgba(224, 236, 252, 0.88);
  display: grid;
  gap: 10px;
}

.back-link {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 11px 16px;
  border: 1px solid rgba(211, 231, 255, 0.2);
  border-radius: 999px;
  background: rgba(211, 231, 255, 0.08);
  box-shadow: 0 14px 28px rgba(5, 13, 24, 0.16);
  text-decoration: none;
  color: #d3e7ff;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.back-link:hover {
  color: #fff;
  border-color: rgba(211, 231, 255, 0.36);
  background: rgba(211, 231, 255, 0.14);
  transform: translateY(-1px);
}

.aside-photo-placeholder {
  margin-top: auto;
  max-height: 320px;
  overflow: hidden;
  padding-top: 22px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease, padding-top 0.25s ease, max-height 0.25s ease;
}

.aside-photo-placeholder__frame {
  min-height: 216px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid rgba(211, 231, 255, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at top right, rgba(63, 130, 243, 0.16), transparent 45%);
}

.aside-photo-placeholder__image {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 216px;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
  vertical-align: top;
}

.auth-layout[data-mode="login"] .aside-photo-placeholder {
  max-height: 0;
  opacity: 0;
  transform: translateY(12px);
  padding-top: 0;
  pointer-events: none;
}

.auth-main {
  padding: clamp(24px, 3.2vw, 36px);
  background: var(--card);
}

.form-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  padding: 4px;
  background: #eaf1fb;
  border-radius: 12px;
}

.tab {
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  color: #436181;
  cursor: pointer;
}

.tab.active {
  background: #fff;
  color: #1b3552;
  box-shadow: 0 6px 16px rgba(26, 54, 87, 0.12);
}

.auth-card {
  display: none;
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  background: #fff;
}

.auth-card.active {
  display: block;
}

.auth-card h2,
.auth-modal__dialog h2 {
  margin: 0 0 14px;
  color: var(--text-dark);
  font-family: var(--font-display);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: #34516f;
  font-weight: 600;
}

.auth-form input {
  border: 1px solid #cadcf0;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  color: #11243b;
}

.auth-form input:focus {
  outline: 2px solid rgba(63, 130, 243, 0.26);
  border-color: #88b3ee;
}

.consent-row {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #cadcf0;
  border-radius: 12px;
  background: #f7fbff;
}

.consent-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--blue);
}

.consent-row span {
  line-height: 1.5;
}

.consent-row a {
  color: var(--blue-deep);
  text-decoration: none;
}

.consent-row a:hover {
  text-decoration: underline;
}

.form-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.submit {
  margin-top: 6px;
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  background: linear-gradient(150deg, var(--blue), var(--blue-deep));
}

.submit:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.link-btn:hover {
  filter: brightness(0.98);
}

.login-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: -2px;
}

.link-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--blue-deep);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.verify-copy,
.reset-copy {
  margin-bottom: 14px;
}

.verify-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.secondary-btn,
.ghost-btn {
  border-radius: 10px;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.secondary-btn {
  border: none;
  color: #15314e;
  background: #eaf1fb;
}

.ghost-btn {
  border: 1px solid #cadcf0;
  color: #34516f;
  background: #fff;
}

.secondary-btn:disabled,
.ghost-btn:disabled,
.submit:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.error {
  min-height: 18px;
  margin: 10px 0 0;
  color: #d9294f;
  font-size: 13px;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 14, 24, 0.58);
  backdrop-filter: blur(6px);
}

.auth-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  border-radius: 22px;
  padding: 28px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(3, 12, 24, 0.3);
}

.auth-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: #eef5ff;
  color: #1b3552;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.reset-step {
  display: none;
}

.reset-step.active {
  display: block;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 920px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    border-bottom: 1px solid rgba(169, 197, 229, 0.26);
  }

  .aside-photo-placeholder {
    display: none;
  }
}

@media (max-width: 640px) {
  body {
    display: block;
    min-height: 100%;
    padding: 0;
  }

  .auth-layout {
    width: min(100%, 100vw);
    margin: 0;
    border-radius: 0;
  }

  .auth-main,
  .auth-aside,
  .auth-card,
  .auth-modal__dialog {
    padding-left: 18px;
    padding-right: 18px;
  }

  .verify-actions {
    flex-direction: column;
  }

  .verify-actions .secondary-btn,
  .verify-actions .ghost-btn {
    width: 100%;
  }
}
