/* auth-modal.css - Babylonia Language Lab Student Authentication Modal */

.babylonia-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 59, 58, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.babylonia-auth-overlay.show {
  opacity: 1;
  visibility: visible;
}

.babylonia-auth-card {
  width: 100%;
  max-width: 440px;
  box-sizing: border-box;
  max-height: calc(100vh - 2.5rem);
  max-height: calc(100dvh - 2.5rem);
  overflow-y: auto;
  background: var(--paper, #fbfaf6);
  border: 1px solid var(--line, #dfd8cb);
  box-shadow: 0 20px 50px rgba(15, 45, 44, 0.2);
  border-radius: 8px;
  padding: 2.25rem 2rem;
  position: relative;
  transform: translateY(16px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Manrope', -apple-system, sans-serif;
  color: var(--ink, #173b3a);
}

.babylonia-auth-overlay.show .babylonia-auth-card {
  transform: translateY(0);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.85rem;
}

.auth-brand-mark {
  width: 32px;
  height: 32px;
  background: var(--coral, #ef715f);
  color: white;
  font-weight: 800;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.auth-brand-text {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ink, #173b3a);
}

.auth-header h2 {
  font-family: 'Source Serif 4', serif;
  font-size: 1.55rem;
  color: var(--ink, #173b3a);
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.auth-lang-pill {
  display: inline-block;
  background: var(--cream, #f5f0e6);
  color: var(--coral, #ef715f);
  border: 1px solid var(--line, #dfd8cb);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 0.6rem;
}

.auth-subtitle {
  font-size: 0.86rem;
  color: var(--muted, #5e6b66);
  line-height: 1.45;
}

.auth-subtitle em {
  display: block;
  font-style: italic;
  font-size: 0.8rem;
  margin-top: 3px;
  color: #798782;
}

/* Form Styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}

.auth-field label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink, #173b3a);
}

.auth-field label small {
  font-weight: normal;
  color: var(--muted, #5e6b66);
  margin-left: 4px;
}

.auth-input {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--line, #dfd8cb);
  background: white;
  border-radius: 4px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--ink, #173b3a);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: var(--coral, #ef715f);
  box-shadow: 0 0 0 3px rgba(239, 113, 95, 0.15);
}

.auth-input.is-invalid {
  border-color: #dc2626 !important;
  background: #fff8f8;
}

.auth-error-alert {
  display: none;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 0.65rem 0.9rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  animation: authFadeIn 0.2s ease;
}

.auth-error-alert.show {
  display: block;
}

.btn-auth-submit {
  width: 100%;
  padding: 0.85rem;
  background: var(--coral, #ef715f);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  margin-top: 0.5rem;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-auth-submit:hover {
  background: #df5e4c;
  transform: translateY(-1px);
}

.btn-auth-submit:active {
  transform: translateY(0);
}

.auth-footer-help {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.74rem;
  color: var(--muted, #5e6b66);
  line-height: 1.4;
  border-top: 1px dashed var(--line, #dfd8cb);
  padding-top: 0.85rem;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .babylonia-auth-card {
    padding: 1.75rem 1.25rem;
  }
}
