/* Auth overlays on marketing landing (login / register cards). */

.iq-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  padding: 88px 4vw 24px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(2px);
  overflow-y: auto;
}

.iq-auth-overlay.open {
  display: flex;
}

.iq-auth-overlay[hidden] {
  display: none !important;
}

.iq-auth-card {
  width: min(420px, 100%);
  margin: auto 0 auto auto;
  padding: 1.5rem 1.375rem 1.125rem;
  background: #ffffff;
  border-radius: 12px;
  border: 0.5px solid #e2e8f0;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #0f172a;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
}

.iq-auth-card .lang-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.25rem;
}

.iq-auth-lang {
  min-width: 128px;
  min-height: 28px;
  padding: 4px 8px;
  border: 0.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.iq-auth-lang:focus-visible {
  outline: 2px solid #e6f1fb;
  border-color: #1a7fd4;
}

.iq-auth-card .brand {
  text-align: center;
  margin-bottom: 1rem;
}

.iq-auth-card .brand-mark {
  width: 52px;
  height: auto;
  display: block;
  margin: 0 auto 0.5rem;
}

.iq-auth-card .brand-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.iq-auth-card .brand-name .flow { color: #0f172a; }
.iq-auth-card .brand-name .app { color: #6350e8; }

.iq-auth-card .brand-tagline {
  margin: 0.15rem 0 0;
  font-size: 12px;
  color: #64748b;
}

.iq-auth-card .brand-subtitle,
.iq-auth-card .hint {
  margin: 0.65rem 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.iq-auth-card h2 {
  margin: 0.75rem 0 0.25rem;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.02em;
}

.iq-auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.iq-auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.iq-auth-field label {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  text-align: center;
}

.iq-auth-field label .req {
  color: #1a7fd4;
}

.iq-auth-field input,
.iq-auth-field select {
  width: 100%;
  min-height: 40px;
  padding: 0.45rem 0.65rem;
  border: 0.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 13px;
  color: #0f172a;
  font-family: inherit;
}

.iq-auth-field input:focus-visible,
.iq-auth-field select:focus-visible {
  outline: 2px solid #e6f1fb;
  border-color: #1a7fd4;
}

.iq-password-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 0.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.iq-password-wrap input {
  border: none;
  background: transparent;
  flex: 1;
  min-width: 0;
}

.iq-password-wrap input:focus-visible {
  outline: none;
}

.iq-password-wrap:focus-within {
  outline: 2px solid #e6f1fb;
  border-color: #1a7fd4;
}

.iq-password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  border: none;
  border-left: 0.5px solid #e2e8f0;
  background: transparent;
  color: #64748b;
  padding: 0 0.65rem;
  cursor: pointer;
}

.iq-password-toggle .iq-eye-icon {
  width: 18px;
  height: 18px;
}

.iq-auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 0.25rem;
  border: none;
  border-radius: 8px;
  background: #1a7fd4;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.iq-auth-submit:hover:not(:disabled) {
  background: #0c447c;
}

.iq-auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.iq-auth-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 0.5px solid #e2e8f0;
  font-size: 13px;
  text-align: center;
}

.iq-auth-register-line {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #64748b;
}

.iq-auth-links a,
.iq-auth-footer a,
.iq-auth-switch a {
  color: #1a7fd4;
  font-weight: 500;
  text-decoration: none;
}

.iq-auth-links a:hover,
.iq-auth-footer a:hover,
.iq-auth-switch a:hover {
  text-decoration: underline;
}

.iq-auth-switch {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 13px;
  color: #64748b;
}

.iq-auth-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 0.5px solid #e2e8f0;
  font-size: 13px;
}

.iq-auth-version {
  font-size: 10px;
  color: #94a3b8;
}

.iq-auth-error,
.iq-auth-success {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.4;
}

.iq-auth-error {
  color: #791f1f;
  background: #fcebeb;
  border: 0.5px solid #a32d2d;
}

.iq-auth-success {
  color: #085041;
  background: #e1f5ee;
  border: 0.5px solid #1d9e75;
}

.iq-auth-panel[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .iq-auth-overlay {
    justify-content: center;
    padding: 88px 16px 24px;
  }

  .iq-auth-card {
    margin: auto;
    max-height: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .iq-auth-overlay {
    backdrop-filter: none;
  }
}
