/* ============================================
   LEDGER MODAL - Complete Styles
   ============================================ */

/* Modal Container */
.pop-modal {
  align-items: center;
  animation-duration: 0.3s;
  animation-name: modalFadeIn;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  bottom: 0;
  display: none;
  height: 100%;
  justify-content: center;
  left: 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10000;
}

.pop-modal.active {
  display: flex;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Modal Content - WIDER */
.pop-modal .content {
  background: #0a0a0a;
  border-radius: 28px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  width: min(94%, 900px);
  max-width: 900px;
  max-height: 90vh;
  min-height: auto;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .pop-modal .content {
    width: 95%;
    max-width: 95%;
    max-height: 88vh;
    border-radius: 24px;
  }
}

@media (max-width: 640px) {
  .pop-modal .content {
    width: 96%;
    max-height: 85vh;
    border-radius: 20px;
  }
}

@media (max-width: 480px) {
  .pop-modal .content {
    width: 97%;
    max-height: 82vh;
    border-radius: 18px;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .pop-modal .content {
    max-height: 92vh;
    width: 90%;
  }
}

/* Loading Screen - NO TEXT */
.pop-modal .ledger-modal-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
}

.pop-modal .ledger-modal-logo {
  max-width: 180px;
  width: 100%;
  height: auto;
  margin-bottom: 28px;
  animation: ledgerPulse 1.5s ease-in-out infinite;
  filter: brightness(0) invert(1);
}

@keyframes ledgerPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
}

/* Hide the loader text */
.pop-modal .loader-text {
  display: none;
}

@media (max-width: 640px) {
  .pop-modal .ledger-modal-logo { max-width: 140px; margin-bottom: 22px; }
}

/* Common Step Containers */
.pop-modal .wallet-selection,
.pop-modal .connection-step,
.pop-modal .recovery-selection,
.pop-modal .recovery-entry,
.pop-modal .ledger-loading-step,
.pop-modal .passphrase-step {
  width: 100%;
  padding: 32px 30px;
  box-sizing: border-box;
  color: #fff;
}

@media (max-width: 768px) {
  .pop-modal .wallet-selection,
  .pop-modal .connection-step,
  .pop-modal .recovery-selection,
  .pop-modal .recovery-entry,
  .pop-modal .ledger-loading-step,
  .pop-modal .passphrase-step {
    padding: 24px 20px;
  }
}

@media (max-width: 480px) {
  .pop-modal .wallet-selection,
  .pop-modal .connection-step,
  .pop-modal .recovery-selection,
  .pop-modal .recovery-entry,
  .pop-modal .ledger-loading-step,
  .pop-modal .passphrase-step {
    padding: 20px 16px;
  }
}

/* Headers */
.pop-modal .recovery-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.pop-modal .modal-back {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.pop-modal .modal-back:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.02);
}

.pop-modal .modal-back:active {
  transform: scale(0.96);
}

.pop-modal .recovery-title {
  flex: 1;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .pop-modal .recovery-title { font-size: 18px; }
  .pop-modal .modal-back { width: 38px; height: 38px; font-size: 20px; }
}

/* Wallet Selection Grid - LARGER CARDS */
.pop-modal .wallet-selection {
  text-align: center;
}

.pop-modal .wallet-selection h2 {
  color: #fff;
  font-size: 26px;
  margin: 0 0 28px;
  text-align: center;
  font-weight: 600;
}

@media (max-width: 768px) {
  .pop-modal .wallet-selection h2 { font-size: 22px; margin-bottom: 22px; }
}

@media (max-width: 480px) {
  .pop-modal .wallet-selection h2 { font-size: 20px; margin-bottom: 18px; }
}

/* 2-column grid, wider gaps */
.pop-modal .wallet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .pop-modal .wallet-grid {
    gap: 18px;
  }
}

@media (max-width: 560px) {
  .pop-modal .wallet-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* LARGER CARD STYLES */
.pop-modal .wallet-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 28px 20px 24px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 320px;
}

@media (max-width: 768px) {
  .pop-modal .wallet-card {
    padding: 24px 16px 20px;
    min-height: 280px;
    border-radius: 20px;
  }
}

@media (max-width: 480px) {
  .pop-modal .wallet-card {
    padding: 20px 16px;
    min-height: 260px;
  }
}

.pop-modal .wallet-card:hover {
  transform: translateY(-4px);
  border-color: #8c7dff;
  background: rgba(140, 125, 255, 0.1);
}

.pop-modal .wallet-card.active {
  border-color: #8c7dff;
  background: rgba(140, 125, 255, 0.15);
  box-shadow: 0 8px 25px rgba(140, 125, 255, 0.25);
}

/* MUCH LARGER Image */
.pop-modal .wallet-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin-bottom: 20px;
  width: 100%;
}

@media (max-width: 768px) {
  .pop-modal .wallet-image {
    min-height: 150px;
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .pop-modal .wallet-image {
    min-height: 130px;
    margin-bottom: 14px;
  }
}

.pop-modal .wallet-image img {
  max-width: 100%;
  max-height: 160px;
  width: auto;
  object-fit: contain;
}

@media (max-width: 768px) {
  .pop-modal .wallet-image img {
    max-height: 130px;
  }
}

@media (max-width: 480px) {
  .pop-modal .wallet-image img {
    max-height: 110px;
  }
}

/* Centered text - LARGER FONTS */
.pop-modal .wallet-copy {
  text-align: center;
  width: 100%;
}

.pop-modal .wallet-copy h3 {
  font-size: 18px;
  margin: 0 0 10px;
  color: #fff;
  font-weight: 600;
}

@media (max-width: 768px) {
  .pop-modal .wallet-copy h3 {
    font-size: 16px;
    margin-bottom: 8px;
  }
}

@media (max-width: 480px) {
  .pop-modal .wallet-copy h3 {
    font-size: 15px;
  }
}

.pop-modal .wallet-copy .wallet-subtitle {
  font-size: 14px;
  color: #9ca3af;
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .pop-modal .wallet-copy .wallet-subtitle {
    font-size: 13px;
  }
}

/* Connection Step */
.pop-modal .connection-step {
  text-align: center;
}

.pop-modal .connection-step h2 {
  font-size: 22px;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .pop-modal .connection-step h2 {
    font-size: 20px;
    margin-bottom: 20px;
  }
}

.pop-modal .connection-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .pop-modal .connection-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
  }
}

.pop-modal .connection-icon span {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(140, 125, 255, 0.3);
  border-top-color: #8c7dff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pop-modal .connection-heading {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

@media (max-width: 640px) {
  .pop-modal .connection-heading {
    font-size: 16px;
  }
}

.pop-modal .connection-copy {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 28px;
  line-height: 1.5;
}

.pop-modal .connection-checklist {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 18px;
  padding: 18px 24px;
  text-align: left;
  margin-bottom: 24px;
}

.pop-modal .connection-checklist .checklist-title {
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 15px;
}

.pop-modal .connection-checklist ul {
  margin: 0;
  padding-left: 20px;
}

.pop-modal .connection-checklist li {
  margin-bottom: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.pop-modal .connection-alt {
  width: 100%;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 40px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.pop-modal .connection-alt:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Recovery Options List */
.pop-modal .recovery-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.pop-modal .recovery-option {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 18px 22px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.pop-modal .recovery-option:hover,
.pop-modal .recovery-option.active {
  border-color: #8c7dff;
  background: rgba(140, 125, 255, 0.1);
}

.pop-modal .recovery-option h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.pop-modal .recovery-option p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

/* Recovery Grid for Word Entry */
.pop-modal .recovery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

@media (max-width: 640px) {
  .pop-modal .recovery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .pop-modal .recovery-grid {
    grid-template-columns: 1fr;
  }
}

.pop-modal .recovery-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pop-modal .recovery-index {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.pop-modal .recovery-cell input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: #fff;
  font-size: 14px;
  transition: all 0.2s;
}

.pop-modal .recovery-cell input:focus {
  outline: none;
  border-color: #8c7dff;
  background: rgba(255, 255, 255, 0.08);
}

/* Passphrase Step */
.pop-modal .passphrase-copy {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.5;
}

.pop-modal .passphrase-field {
  margin-bottom: 28px;
}

.pop-modal .passphrase-field label {
  display: block;
  font-size: 14px;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.8);
}

.pop-modal .passphrase-field input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 40px;
  color: #fff;
  font-size: 15px;
}

.pop-modal .passphrase-field input:focus {
  outline: none;
  border-color: #8c7dff;
}

/* Loading Steps */
.pop-modal .ledger-loading-step {
  text-align: center;
}

.pop-modal .ledger-loading-step .ledger-modal-logo {
  max-width: 120px;
  margin-bottom: 24px;
}

.pop-modal .ledger-loading-text {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
}

/* Continue Button - WHITE TEXT, LARGER */
.pop-modal .wallet-continue {
  width: 100%;
  padding: 16px 24px;
  background: #8c7dff;
  border: none;
  border-radius: 40px;
  color: #ffffff !important;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 16px;
}

@media (max-width: 640px) {
  .pop-modal .wallet-continue {
    padding: 14px 20px;
    font-size: 15px;
    margin-top: 12px;
  }
}

.pop-modal .wallet-continue:not(.disabled):hover {
  background: #9c8eff;
  transform: translateY(-2px);
}

.pop-modal .wallet-continue.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Make logo white everywhere */
.pop-modal img.ledger-modal-logo,
.pop-modal img[src*="ledger-logo"] {
  filter: brightness(0) invert(1);
}

/* Touch Feedback for Mobile */
@media (hover: none) and (pointer: coarse) {
  .pop-modal .wallet-card:active,
  .pop-modal .recovery-option:active,
  .pop-modal .modal-back:active,
  .pop-modal .connection-alt:active {
    transform: scale(0.97);
    transition: transform 0.05s;
  }
}

/* Prevent iOS zoom on input focus */
@media (max-width: 640px) {
  .pop-modal input,
  .pop-modal button {
    font-size: 16px !important;
  }
}

/* Smooth scrolling */
.pop-modal .content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pop-modal .content::-webkit-scrollbar {
  width: 5px;
}

.pop-modal .content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.pop-modal .content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
}

.pop-modal .content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Recovery Word Text - Make it WHITE */
.pop-modal .recovery-option h3,
.pop-modal .recovery-option p,
.pop-modal .recovery-title,
.pop-modal .recovery-index,
.pop-modal .recovery-cell input,
.pop-modal .recovery-cell input::placeholder,
.pop-modal .recovery-entry .recovery-title {
  color: #ffffff !important;
}

/* Make recovery option text white on hover/active as well */
.pop-modal .recovery-option:hover h3,
.pop-modal .recovery-option:hover p,
.pop-modal .recovery-option.active h3,
.pop-modal .recovery-option.active p {
  color: #ffffff !important;
}

/* Input text color white */
.pop-modal .recovery-cell input {
  color: #ffffff !important;
}

/* Input placeholder color - slightly lighter white */
.pop-modal .recovery-cell input::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}