/* modals.css — overlays, dialogs, modal controls */

/* Base overlay (used by voice modal, teach modal, password modal, speech alias modal) */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 100;
}

/* Allow hiding any element via the shared utility */
.modal-overlay.hidden{ display: none; }

/* Some modals are toggled by adding an .open class */
.modal-overlay.open{
  display: flex;
}

.modal{
  width: 100%;
  max-width: 560px;
  background: rgba(35, 21, 8, 0.98);
  border: 1px solid #5a3a10;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 22px 60px rgba(0,0,0,0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal h2{
  font-family: 'Cinzel', serif;
  color: #c9a227;
  font-size: 1.02rem;
  margin-bottom: 12px;
  border-bottom: 1px solid #5a3a10;
  padding-bottom: 10px;
  letter-spacing: 0.8px;
}

.modal p{
  color: #e8d5a3;
  line-height: 1.55;
}

.field{ margin-top: 12px; }
.field label{
  display: block;
  color: #a08060;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.field input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 10px;
  border: 2px solid #5a3a10;
  background: rgba(46,27,8,0.7);
  color: #e8d5a3;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1rem;
  outline: none;
}

.field input:focus{
  border-color: #c9a227;
  box-shadow: 0 0 0 3px rgba(201,162,39,0.18);
}

.modal-msg{
  margin-top: 12px;
  font-size: 0.95rem;
  color: #a08060;
  min-height: 1.2em;
}

.modal-msg.ok{ color: #a8e6c1; }
.modal-msg.err{ color: #ffb1a0; }

.modal-btns{
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Reuse existing ctrl-btn styles but ensure buttons in modals are comfortable */
.modal .ctrl-btn{
  min-width: 120px;
}

/* Voice settings screen uses .panel but also inline modal-like UI; keep consistent */
#speechAliasModal .panel{
  background: rgba(46,27,8,0.45);
  border: 1px solid #3a2010;
}

@media (max-width: 420px){
  .modal{ padding: 16px; }
  .modal-btns{ justify-content: center; }
}
