/* Forzar hover correcto en botón primary */
.keystore-btn.primary:hover {
  background: #6B0F0F !important;
  color: #fff !important;
  border: 1.5px solid #6B0F0F !important;
}

/* Quitar subrayado en enlaces keystore-btn */
a.keystore-btn {
  text-decoration: none !important;
}
/* Header y navegación */
.main-header {
  width: 100%;
  background: #220F17;
  box-shadow: 0 2px 12px rgba(247,147,26,0.12);
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}
.header-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}
.project-title {
  color: #f7931a;
  font-size: 1.25em;
  font-weight: bold;
  letter-spacing: 1px;
}
.main-nav {
  display: flex;
  gap: 18px;
}
.main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.18s;
}
.main-nav a.active, .main-nav a:hover {
  background: #f7931a;
  color: #220F17;
}
/* Subir la card para que quede más arriba */
.keystore-container {
  margin-top: 16px;
  height: auto;
  min-height: 0;
}
/* UTXO List Styles */
#utxoList {
  margin-top: 16px;
  margin-bottom: 8px;
}
.utxo-row {
  display: flex;
  align-items: center;
  background: #2a1620;
  border-radius: 6px;
  padding: 7px 12px;
  margin-bottom: 6px;
}
.utxo-radio {
  accent-color: #f7931a;
  width: 18px;
  height: 18px;
}

.utxo-row.pending {
  background: rgba(247,147,26,0.12);
  border: 1px dashed #f7931a;
  padding: 6px;
  border-radius: 6px;
}

.utxo-row.pending label {
  color: #f3b26f !important;
}

.utxo-row.pending .utxo-radio {
  pointer-events: none;
}

.utxo-badge {
  color: #f7931a;
  font-size: 0.85em;
  margin-left: 8px;
}

.no-utxos-msg {
  color: #fff8ef;
  background: rgba(247, 147, 26, 0.12);
  border: 1px dashed rgba(247, 147, 26, 0.45);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
}

.utxo-burned-msg {
  color: #81c784;
  padding: 10px 14px;
  background: rgba(129, 199, 132, 0.1);
  border: 1px solid rgba(129, 199, 132, 0.3);
  border-radius: 8px;
  margin-top: 8px;
  margin-bottom: 8px;
  font-size: 0.9em;
}

.utxo-label {
  margin-left: 8px;
  color: #fff;
}

.utxo-pending-label {
  margin-left: 8px;
  color: #f3b26f;
}

.utxo-bottle-icon {
  height: 3em;
  vertical-align: middle;
  margin-right: 10px;
}

.utxo-bottle-icon-pending {
  height: 3em;
  vertical-align: baseline;
  margin-left: 8px;
  margin-right: 10px;
}

#burnReason {
  background-color: #220F17;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 4px;
  padding: 6px 8px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

#burnReason option {
  background-color: #220F17;
  color: #fff;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: #1a0b10;
  background-image: none;
}

.keystore-container {
  width: 100vw;
  box-sizing: border-box;
  /* Eliminado flex para que la card quede arriba */
}

.keystore-card {
  position: relative;
  background: #220F17;
  border: none;
  border-radius: 15px;
  padding: 24px 32px;
  box-shadow: 0 8px 32px rgba(247, 147, 26, 0.3);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  min-width: 320px;
  max-width: 400px;
  min-height: 40vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.keystore-header {
  width: 100%;
  position: relative;
  text-align: center;
}

.keystore-header h2 {
  margin: 0 0 8px 0;
  color: #f7931a;
}

/* Botón de cierre accesible (aspa ✕) para tarjeta y submodal */
.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(247, 147, 26, 0.35);
  background: rgba(247, 147, 26, 0.1);
  color: #f7931a;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  z-index: 5;
}

.keystore-header .modal-close-btn {
  top: 0;
  right: 0;
}

.modal-close-btn:hover,
.modal-close-btn:focus-visible {
  background: #6B0F0F;
  border-color: #f7931a;
  color: #ffffff;
  transform: scale(1.08);
  outline: 2px solid rgba(247, 147, 26, 0.6);
  outline-offset: 2px;
}

.keystore-card p {
  color: #fff;
  margin-bottom: 18px;
}

.card-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

#utxoList {
  margin: 16px 0 0 0;
}

.burn-reason-field {
  margin-top: 12px;
  display: block;
}

.consume-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Modal básico para passphrase */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.is-open {
  display: flex;
}

.modal-content {
  position: relative;
  background: #220F17;
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 4px 24px rgba(247, 147, 26, 0.25);
  min-width: 280px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-header {
  width: 100%;
  padding-right: 28px;
  box-sizing: border-box;
}

.modal-content h3 {
  color: #f7931a;
  margin-top: 8px;
  margin-bottom: 12px;
}

.modal-content input[type="password"] {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #f7931a;
  margin-bottom: 16px;
  width: 100%;
  font-size: 1em;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.keystore-btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  background: #f7931a;
  color: #220F17;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.keystore-btn.primary {
  background: #f7931a;
  color: #fff !important;
}

.keystore-btn.secondary {
  background: transparent;
  color: #f0e6e8 !important;
  border: 1.5px solid rgba(247, 147, 26, 0.45);
}

.keystore-btn.secondary:hover,
.keystore-btn.secondary:focus-visible {
  background: rgba(247, 147, 26, 0.15) !important;
  color: #ffffff !important;
  border-color: #f7931a !important;
}

.keystore-btn:disabled {
  background: #888;
  color: #ccc;
  cursor: not-allowed;
}

/* Clases utilitarias para erradicar estilos inline (CSP compliant) */
.wallet-mismatch-cta-row {
  margin-top: 8px;
}

.wallet-mismatch-cta-link {
  font-size: 0.85rem;
  padding: 4px 14px;
  text-decoration: none;
}

.wallet-mismatch-advice-spaced {
  margin-top: 14px;
}

.keystore-status {
  color: #f7931a;
  font-size: 0.95em;
  min-height: 24px;
  text-align: center;
}

label {
  color: #fff;
  font-weight: 500;
  margin-bottom: 6px;
  display: block;
}

input[type="text"], input[type="number"] {
  background: #2a1620;
  color: #fff;
  border: 1px solid #f7931a;
  border-radius: 6px;
  padding: 8px;
  margin-top: 4px;
  width: 100%;
  font-size: 1em;
}

@media (max-width: 700px) {
  body { justify-content: flex-start; align-items: stretch; }
  .keystore-container { width: 100%; padding: 0 4vw; margin-top: 96px; }
  .keystore-card { max-width: 100%; width: 100%; min-width: 0; margin: 12px 0; padding: 18px 4vw; border-radius: 12px; box-sizing: border-box; }
  .keystore-header h2 { font-size: 1.2rem; text-align: center; }
  .keystore-card p { font-size: 0.95rem; text-align: center; }
  .card-actions, .keystore-actions { flex-direction: column; gap: 10px; width: 100%; }
  .keystore-btn { width: 100%; min-height: 40px; }
  .keystore-btn:last-child { margin-bottom: 8px; }
  label { font-size: 0.95rem; }
  input[type="text"], input[type="number"], input[type="password"], input[type="file"], select { width: 100%; font-size: 1rem; padding: 10px; }
  .modal-content { max-width: 90%; min-width: 0; }
  .modal-content h3 { font-size: 1rem; }
  .modal-content input[type="password"] { font-size: 0.95rem; }
}