/* Login / Signup modal — design follows LoginSignupModal.tsx */

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.login-modal[hidden] {
  display: none;
}

.login-modal.is-open {
  opacity: 1;
}

.login-modal__scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  cursor: default;
  background: oklch(0.17 0.012 260 / 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.login-modal__panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  background: var(--card, #fff);
  box-shadow: var(--shadow-lift);
  transform: translateY(1.25rem) scale(0.97);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.login-modal.is-open .login-modal__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.login-modal__close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--background);
  color: var(--foreground);
  cursor: pointer;
  transition: background 0.2s ease;
}

.login-modal__close:hover {
  background: var(--surface);
}

.login-modal__close svg {
  width: 1rem;
  height: 1rem;
}

.login-modal__screen[hidden] {
  display: none;
}

.login-modal__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.login-modal__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  transition: background 0.2s ease;
}

.login-modal__back:hover {
  background: var(--surface);
}

.login-modal__back svg {
  width: 1rem;
  height: 1rem;
}

.login-modal__title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.login-modal__sub {
  margin-top: 0.625rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted-foreground);
}

.login-modal__art {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}

.login-modal__art img {
  height: auto;
  max-width: 100%;
}

.login-modal__label {
  display: block;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--foreground);
}

.login-modal__phone {
  display: flex;
  align-items: center;
  margin-top: 0.375rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--background);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-modal__phone:focus-within {
  border-color: oklch(0.55 0.19 258 / 0.6);
  box-shadow: 0 0 0 2px oklch(0.55 0.19 258 / 0.25);
}

.login-modal__cc {
  padding-left: 0.875rem;
  padding-right: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.login-modal__divider {
  width: 1px;
  height: 1.5rem;
  background: var(--border);
}

.login-modal__phone input {
  width: 100%;
  min-width: 0;
  height: 2.75rem;
  padding-inline: 0.75rem;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  color: var(--foreground);
  outline: none;
}

.login-modal__otp {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.login-modal__otp input {
  width: 100%;
  min-width: 0;
  height: 3rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--background);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-modal__otp input:focus {
  border-color: oklch(0.55 0.19 258 / 0.6);
  box-shadow: 0 0 0 2px oklch(0.55 0.19 258 / 0.25);
}

.login-modal__error {
  margin-top: 0.5rem;
  font-size: 0.78125rem;
  color: var(--destructive);
  min-height: 1rem;
}

.login-modal__resend {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.login-modal__resend .is-waiting {
  color: var(--muted-foreground);
}

.login-modal__resend-btn {
  padding: 0;
  border: none;
  background: none;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.login-modal__resend-btn:hover {
  text-decoration: underline;
}

.login-modal__cta {
  width: 100%;
  height: 2.75rem;
  margin-top: 1.25rem;
  border: none;
  border-radius: 9999px;
  background: var(--foreground);
  color: var(--background);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.login-modal__cta:hover:not(:disabled) {
  background: oklch(from var(--foreground) l c h / 0.9);
}

.login-modal__cta:disabled {
  cursor: not-allowed;
  background: oklch(0.55 0.014 260 / 0.25);
  color: var(--muted-foreground);
}

.login-modal__legal {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.login-modal__legal a {
  color: var(--primary);
}

.login-modal__legal a:hover {
  text-decoration: underline;
}
