/* Layout */
body {
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--bg-secondary);
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

body::before,
body::after {
  content: '';
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  z-index: -2;
  animation: orbit 24s ease-in-out infinite alternate;
}

body::before {
  width: clamp(28rem, 52vw, 44rem);
  height: clamp(28rem, 52vw, 44rem);
  top: -18rem;
  left: -14rem;
  background: radial-gradient(circle at center, rgba(63, 183, 180, 0.28), transparent 70%);
  animation-delay: -6s;
}

body::after {
  width: clamp(26rem, 48vw, 38rem);
  height: clamp(26rem, 48vw, 38rem);
  bottom: -16rem;
  right: -14rem;
  background: radial-gradient(circle at center, rgba(31, 143, 138, 0.24), transparent 70%);
}

@keyframes orbit {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(6%, -4%) scale(1.08);
  }
}

#content.content-auth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-viewport {
  width: min(880px, 100%);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-container {
  width: min(520px, 100%);
  max-height: min(620px, 90vh);
  padding: clamp(2.4rem, 4vw, 3rem);
  background: var(--bg-primary);
  border-radius: 26px;
  border: 1px solid rgba(63, 183, 180, 0.14);
  box-shadow:
    0 30px 60px rgba(9, 26, 42, 0.25),
    0 18px 28px rgba(9, 26, 42, 0.16);
  backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  gap: clamp(1.8rem, 3vw, 2.5rem);
  position: relative;
  overflow: hidden;
}

.auth-container--tall {
  max-height: none;
  overflow: visible;
  align-self: flex-start;
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
}

.auth-container::before,
.auth-container::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-container::before {
  background: radial-gradient(70% 70% at 20% 12%, rgba(125, 224, 221, 0.18), transparent 62%);
  mix-blend-mode: soft-light;
}

.auth-container::after {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.06), rgba(63, 183, 180, 0.08) 48%, transparent 70%);
  opacity: 0.4;
}

.auth-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(1.6rem, 2.8vw, 2.1rem);
  position: relative;
  z-index: 1;
  min-height: 0;
}

.auth-header {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  text-align: center;
}

.auth-badge {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-primary);
  background: rgba(63, 183, 180, 0.12);
  border: 1px solid rgba(63, 183, 180, 0.28);
  backdrop-filter: blur(6px);
  animation: badgePulse 14s ease-in-out infinite;
}

@keyframes badgePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(63, 183, 180, 0.25);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(63, 183, 180, 0);
  }
}

.auth-title {
  margin: 0;
  font-size: clamp(1.85rem, 2.4vw, 2.25rem);
  font-weight: 700;
  color: var(--text-primary);
}

.auth-subtitle {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.profile-type-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  border: 1px solid rgba(63, 183, 180, 0.16);
  backdrop-filter: blur(12px);
}

.toggle-option {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: all 0.24s ease;
}

.toggle-option i {
  width: 18px;
  height: 18px;
  stroke-width: 1.9px;
}

.toggle-option:hover {
  background: rgba(63, 183, 180, 0.12);
}

.toggle-option:focus-visible {
  outline: 2px solid rgba(63, 183, 180, 0.45);
  outline-offset: 3px;
}

.toggle-option.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--text-white);
  box-shadow: 0 14px 28px rgba(63, 183, 180, 0.35);
  transform: translateY(-1px);
}

.auth-form {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.05rem, 2.4vw, 1.45rem);
  min-height: 0;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.15rem;
  margin-top: 0.3rem;
}

.password-guidelines {
  position: relative;
  margin-top: 0.8rem;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(63, 183, 180, 0.2);
  background: rgba(63, 183, 180, 0.09);
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

.password-guidelines strong {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
  font-size: 0.92rem;
}

.password-guidelines [data-guideline] {
  position: relative;
  margin: 0;
  padding-left: 1.6rem;
  display: block;
  transition: color 0.2s ease;
}

.password-guidelines [data-guideline]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(17, 61, 77, 0.24);
  background: rgba(17, 61, 77, 0.1);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.password-guidelines [data-guideline][data-valid="true"] {
  color: var(--accent-primary);
  font-weight: 600;
}

.password-guidelines [data-guideline][data-valid="true"]::before {
  background: var(--accent-primary);
  border-color: rgba(11, 90, 87, 0.4);
  transform: scale(1.12);
}

.password-guidelines [data-guideline][data-valid="false"]::before {
  border-color: rgba(220, 82, 80, 0.28);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.3rem;
}

.form-group label {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="file"] {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(17, 34, 36, 0.12);
  background: var(--bg-elevated);
  font-size: 1rem;
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group input:focus-visible {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(63, 183, 180, 0.18);
  background: var(--bg-input);
}

.pilot-only {
  margin-top: 0.4rem;
  padding: 1.25rem;
  border: 1px dashed rgba(63, 183, 180, 0.35);
  border-radius: 16px;
  background: rgba(63, 183, 180, 0.07);
  display: grid;
  gap: 1.15rem;
}

.pilot-only[hidden] {
  display: none;
}

.file-group {
  gap: 0.75rem;
}

.file-group input[type="file"] {
  display: none;
}

.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 1.2rem;
  background: rgba(63, 183, 180, 0.14);
  color: var(--accent-primary);
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  border: 1px solid rgba(63, 183, 180, 0.26);
}

.file-label:hover {
  background: rgba(63, 183, 180, 0.22);
}

.file-label i {
  width: 18px;
  height: 18px;
  stroke-width: 1.8px;
}

.helper-text {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 0.3rem;

}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 0.12rem;
  border-radius: 4px;
  border: 1px solid rgba(17, 34, 36, 0.12);
  accent-color: var(--accent-primary);
}

.form-checkbox a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
}

.form-checkbox a:hover {
  text-decoration: underline;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-white);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  margin-top: 0.3rem;
  box-shadow: 0 18px 40px rgba(63, 183, 180, 0.32);
}

.submit-btn i {
  width: 18px;
  height: 18px;
  stroke-width: 1.8px;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 46px rgba(63, 183, 180, 0.38);
  filter: brightness(1.04);
}

.submit-btn:focus-visible {
  outline: 2px solid rgba(63, 183, 180, 0.4);
  outline-offset: 4px;
}

.form-feedback-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.form-feedback {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  border: 1px solid transparent;
}

.form-feedback[hidden] {
  display: none;
}

.form-feedback--error {
  background: rgba(220, 65, 65, 0.14);
  border-color: rgba(220, 65, 65, 0.32);
  color: #ff9393;
}

.form-feedback--success {
  background: rgba(39, 163, 118, 0.16);
  border-color: rgba(39, 163, 118, 0.32);
  color: #50d3a4;
}

.auth-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.88rem;
  position: relative;
  z-index: 1;
}

.auth-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.auth-link i {
  width: 17px;
  height: 17px;
  stroke-width: 1.9px;
}

.auth-link:hover {
  color: var(--accent-hover);
  transform: translateY(-1px);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  width: 100%;
  padding-right: 2.5rem;
}

.toggle-password {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #666;
  padding: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password:hover {
  color: #3BAFA2;
}

.toggle-password i {
  width: 20px;
  height: 20px;
}

/* Responsive */
@media (max-width: 740px) {
  body {
    padding: 2rem 1.5rem;
  }

  .auth-container {
    padding: 2.2rem;
    border-radius: 22px;
    max-height: min(660px, 92vh);
  }

  .auth-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-link {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  body {
    padding: 1.75rem 1.25rem;
  }

  .profile-type-toggle {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .pilot-only {
    padding: 1.05rem;
  }
}

@media (max-height: 780px) {
  .auth-container {
    max-height: 96vh;
    transform: scale(0.94);
    transform-origin: center;
  }
}

@media (max-height: 640px) {
  .auth-container {
    transform: scale(0.88);
  }
}
