/* ─────────────────────────────────────────────────────────
   NordKI · modals.css
   Login & Registrierung Modals
───────────────────────────────────────────────────────── */

/* hidden-Attribut darf nie von CSS überschrieben werden */
[hidden] { display: none !important; }

/* ── BACKDROP ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* ── MODAL BOX ── */
.modal {
  background: #141517;
  border: 1px solid #272b31;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  position: relative;
  transform: translateY(10px) scale(0.99);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

/* ── CLOSE BUTTON ── */
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #666;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: 'Outfit', sans-serif;
}

.modal-close:hover {
  color: #e2dfd8;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
}

/* ── HEADER ── */
.modal-header { margin-bottom: 28px; }

.modal-logo {
  margin-bottom: 18px;
}

.modal-title {
  font-family: 'Instrument Serif', serif;
  font-size: 26px;
  line-height: 1.2;
  color: #e2dfd8;
  margin-bottom: 6px;
  font-weight: normal;
}

.modal-subtitle {
  font-size: 14px;
  color: #5e5c56;
  line-height: 1.5;
}

/* ── FORM ── */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: #9e9b94;
}

.form-group input {
  background: #0c0d0f;
  border: 1px solid #272b31;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px;
  color: #e2dfd8;
  font-family: 'Outfit', sans-serif;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  -webkit-appearance: none;
}

.form-group input::placeholder { color: #333530; }

.form-group input:focus {
  border-color: #3d8060;
  box-shadow: 0 0 0 3px rgba(61, 128, 96, 0.14);
}

/* ── SELECT & TEXTAREA ── */
.form-group select,
.form-group textarea {
  background: #0c0d0f;
  border: 1px solid #272b31;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px;
  color: #e2dfd8;
  font-family: 'Outfit', sans-serif;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  -webkit-appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235e5c56' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-group select option { background: #1a1c1f; }

.form-group textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.55;
}

.form-group select:focus,
.form-group textarea:focus {
  border-color: #3d8060;
  box-shadow: 0 0 0 3px rgba(61, 128, 96, 0.14);
}

.label-optional {
  font-size: 11px;
  color: #5e5c56;
  font-weight: 400;
}

/* ── CHECKBOX ── */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #3d8060;
  cursor: pointer;
}

.form-check label {
  font-size: 13px;
  color: #5e5c56;
  cursor: pointer;
  line-height: 1.55;
}

.form-check label a {
  color: #3d8060;
  text-decoration: none;
}

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

/* ── ERROR MESSAGE ── */
.form-error {
  background: rgba(200, 55, 55, 0.07);
  border: 1px solid rgba(200, 55, 55, 0.2);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #e07878;
  line-height: 1.5;
}

/* ── SUBMIT BUTTON STATE ── */
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-spinner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-spinner::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── FOOTER TEXT ── */
.modal-footer-text {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: #5e5c56;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #3d8060;
  font-size: 13px;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
}

.link-btn:hover { text-decoration: underline; }

/* ── MOBILE ── */
@media (max-width: 480px) {
  .modal { padding: 28px 22px; }
  .modal-title { font-size: 22px; }
}
