.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: rgba(6, 24, 17, 0.72);
  padding: 1rem;
  backdrop-filter: blur(5px);
}

.auth-modal-card {
  width: 100%;
  max-width: 32rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  background: #fff;
  padding: 1.25rem;
  color: #0f172a;
  box-shadow: 0 28px 80px -24px rgba(0, 0, 0, 0.55);
}

.auth-modal-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.auth-modal-card header small { display: block; margin-bottom: .25rem; color: #24553e; font-size: .68rem; font-weight: 900; letter-spacing: .14em; }
.auth-modal-card header h2 { font-size: 1.3rem; line-height: 1.25; font-weight: 900; }
.auth-modal-card .close { flex-shrink: 0; border-radius: .65rem; background: #e9eef5; padding: .55rem .75rem; font-size: .8rem; font-weight: 800; color: #334155; }
.auth-modal-intro { margin: 1rem 0; color: #64748b; font-size: .875rem; line-height: 1.5; }
.auth-modal .auth-tabs { margin-bottom: 1rem; }
.auth-modal form { display: grid; gap: .85rem; }
.auth-modal form label { display: block; color: #334155; font-size: .8rem; font-weight: 800; }
.auth-modal form input { display: block; width: 100%; margin-top: .3rem; border: 1px solid #dbe3ec; border-radius: .7rem; background: #fff; padding: .7rem .8rem; color: #0f172a; outline: none; }
.auth-modal form input:focus { border-color: #60a27e; box-shadow: 0 0 0 3px #deeee5; }
.auth-modal form input.field-invalid, .auth-card form input.field-invalid { border-color: #dc2626; box-shadow: 0 0 0 3px #fee2e2; }
.field-help { display: block; margin-top: .3rem; color: #64748b; font-size: .7rem; font-weight: 500; }
.auth-modal .auth-grid { gap: .75rem; }
.auth-modal .auth-submit { width: 100%; margin-top: .15rem; }
.auth-modal .auth-message { min-height: 1.25rem; margin: .75rem 0 0; color: #b91c1c; font-size: .82rem; }
.auth-modal-full { display: block; margin-top: .35rem; text-align: center; color: #24553e; font-size: .78rem; font-weight: 700; text-decoration: underline; }
.password-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem .75rem; margin-top: .55rem; color: #64748b; font-size: .7rem; font-weight: 600; }
.password-rules li::before { content: '○'; margin-right: .3rem; color: #94a3b8; }
.password-rules li.valid { color: #166534; }
.password-rules li.valid::before { content: '✓'; color: #16a34a; font-weight: 900; }
.auth-card .password-rules { margin-bottom: 0; }

@media (min-width: 640px) {
  .auth-modal-card { padding: 1.5rem; }
}

@media (max-width: 639px) {
  .auth-modal { align-items: end; padding: 0; }
  .auth-modal-card { max-height: 92vh; border-radius: 1.25rem 1.25rem 0 0; }
  .auth-modal .auth-grid { grid-template-columns: 1fr; }
}
