/* ============================================
   WALLET SETUP PAGE
   Colors: #FE5722 (buttons), #FF9700 (text/accents)
   ============================================ */

.wallet-setup-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 20px 80px;
  background: var(--bg);
  min-height: 100vh;
}

/* ═══════════════════════════════════════════
   HERO SECTION
═══════════════════════════════════════════ */
.wallet-hero {
  text-align: center;
  padding: 32px 20px;
  background: linear-gradient(135deg, var(--c-secondary) 0%, var(--c-primary) 100%);
  border-radius: 20px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.wallet-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  pointer-events: none;
}

.wallet-hero-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
  position: relative;
  z-index: 1;
}

.wallet-hero-title {
  font-size: 1.75rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -.5px;
  position: relative;
  z-index: 1;
}

.wallet-hero-subtitle {
  font-size: .9375rem;
  color: rgba(255, 255, 255, .92);
  font-weight: 500;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════
   FORM SECTION
═══════════════════════════════════════════ */
.wallet-form-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.form-label {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--t-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-label i {
  font-size: 1.125rem;
  color: var(--c-primary);
}

/* Network Options */
.network-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.network-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px;
  background: var(--surface);
  border: 2px solid var(--border2);
  border-radius: 16px;
  cursor: pointer;
  transition: all .2s var(--ease);
  position: relative;
}

.network-option:hover {
  border-color: rgba(254,87,34,.3);
  transform: translateX(3px);
}

.network-option.active {
  border-color: var(--c-primary);
  background: linear-gradient(135deg, rgba(254,87,34,.05) 0%, rgba(255,151,0,.05) 100%);
}

.network-radio {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  position: relative;
  flex-shrink: 0;
  transition: all .2s var(--ease);
}

.network-option.active .network-radio {
  border-color: var(--c-primary);
}

.network-option.active .network-radio::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--c-primary);
}

.network-info {
  flex: 1;
}

.network-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--t-dark);
  margin-bottom: 4px;
}

.network-desc {
  font-size: .8125rem;
  color: var(--t-muted);
  font-weight: 500;
}

.network-badge {
  padding: 5px 12px;
  border-radius: 10px;
  font-size: .6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.network-badge.recommended {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
}

/* Wallet Input */
.wallet-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.wallet-input {
  flex: 1;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid var(--border2);
  border-radius: 14px;
  font-size: .9375rem;
  color: var(--t-dark);
  font-weight: 600;
  transition: all .2s var(--ease);
  font-family: 'Courier New', monospace;
}

.wallet-input:focus {
  outline: none;
  border-color: var(--c-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(254,87,34,.1);
}

.wallet-input::placeholder {
  color: var(--t-muted);
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 500;
}

.paste-button {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  background: var(--surface);
  border: 2px solid var(--border2);
  border-radius: 14px;
  color: var(--t-sub);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all .2s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}

.paste-button:hover {
  background: linear-gradient(135deg, var(--c-secondary-pale) 0%, var(--c-primary-pale) 100%);
  color: var(--c-primary);
  border-color: transparent;
}

.input-helper {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: #FFF9F0;
  border-radius: 12px;
  border: 1px solid #FFE8CC;
}

.input-helper i {
  font-size: 1.125rem;
  color: var(--c-secondary);
  flex-shrink: 0;
  margin-top: 1px;
}

.input-helper span {
  font-size: .8125rem;
  color: var(--t-body);
  font-weight: 500;
  line-height: 1.5;
}

/* Notice Box */
.wallet-notice {
  background: #FFF9F0;
  border: 1px solid #FFE8CC;
  border-radius: 16px;
  padding: 20px 20px;
}

.notice-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--c-secondary);
  margin-bottom: 14px;
}

.notice-header i {
  font-size: 1.25rem;
}

.notice-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notice-list li {
  font-size: .875rem;
  color: var(--t-body);
  line-height: 1.6;
  font-weight: 500;
}

.notice-list li::marker {
  color: var(--c-secondary);
}

/* Save Button */
.wallet-save-btn {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--c-secondary) 0%, var(--c-primary) 100%);
  border: none;
  border-radius: 16px;
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s var(--ease);
  box-shadow: 0 6px 20px rgba(254,87,34,.25);
  position: relative;
  overflow: hidden;
}

.wallet-save-btn .btn-content,
.wallet-save-btn .btn-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all .3s var(--ease);
}

.wallet-save-btn .btn-loader {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.wallet-save-btn.loading .btn-content {
  opacity: 0;
  transform: translateY(-10px);
}

.wallet-save-btn.loading .btn-loader {
  opacity: 1;
  transform: translateY(0);
}

.wallet-save-btn:hover:not(.loading):not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(254,87,34,.35);
}

.wallet-save-btn:active:not(.loading):not(:disabled) {
  transform: translateY(-1px);
}

.wallet-save-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

/* Loader Spinner */
.loader-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ═══════════════════════════════════════════
   CONFIGURED WALLET SECTION
═══════════════════════════════════════════ */
.configured-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border2);
  text-align: center;
}

.configured-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10b981;
  font-size: 3rem;
}

.configured-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--t-dark);
  margin-bottom: 24px;
}

.configured-details {
  background: var(--surface2);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
  text-align: left;
}

.configured-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border2);
}

.configured-row:last-child {
  border-bottom: none;
}

.configured-label {
  font-size: .875rem;
  color: var(--t-muted);
  font-weight: 600;
}

.configured-value {
  font-size: .9375rem;
  color: var(--t-dark);
  font-weight: 700;
}

.configured-value.address {
  font-family: 'Courier New', monospace;
  color: var(--c-primary);
}

.change-wallet-btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--surface2);
  border: 2px solid var(--border2);
  border-radius: 14px;
  color: var(--t-dark);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.change-wallet-btn:hover {
  background: linear-gradient(135deg, var(--c-secondary-pale) 0%, var(--c-primary-pale) 100%);
  color: var(--c-primary);
  border-color: transparent;
}

/* ═══════════════════════════════════════════
   NOTIFICATION
═══════════════════════════════════════════ */
.wallet-notification {
  position: fixed;
  top: 80px;
  right: -400px;
  max-width: 380px;
  width: calc(100% - 40px);
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .15);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 10000;
  transition: all .3s var(--ease);
  border-left: 4px solid #10b981;
}

.wallet-notification.show {
  right: 20px;
}

.wallet-notification > i {
  font-size: 2rem;
  color: #10b981;
  flex-shrink: 0;
}

.notification-title {
  font-size: .9375rem;
  font-weight: 800;
  color: var(--t-dark);
  margin-bottom: 4px;
}

.notification-text {
  font-size: .8125rem;
  color: var(--t-sub);
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .wallet-setup-container {
    /* Clear the fixed bottom nav so the Save button isn't hidden behind it. */
    padding: 14px 16px calc(var(--nav-h, 60px) + 40px);
  }

  .wallet-hero {
    padding: 28px 18px;
  }

  .wallet-hero-icon {
    width: 66px;
    height: 66px;
    font-size: 2.25rem;
  }

  .wallet-hero-title {
    font-size: 1.625rem;
  }

  .network-option {
    padding: 16px 16px;
  }

  .configured-card {
    padding: 28px 24px;
  }

  .configured-icon {
    width: 72px;
    height: 72px;
    font-size: 2.75rem;
  }

  .configured-title {
    font-size: 1.375rem;
  }
}

@media (max-width: 480px) {
  .wallet-setup-container {
    /* Clear the fixed bottom nav so the Save button isn't hidden behind it. */
    padding: 12px 14px calc(var(--nav-h, 60px) + 40px);
  }

  .wallet-hero {
    padding: 24px 16px;
  }

  .wallet-hero-icon {
    width: 62px;
    height: 62px;
    font-size: 2rem;
  }

  .wallet-hero-title {
    font-size: 1.5rem;
  }

  .wallet-hero-subtitle {
    font-size: .875rem;
  }

  .network-option {
    padding: 14px 14px;
  }

  .network-name {
    font-size: .9375rem;
  }

  .network-desc {
    font-size: .75rem;
  }

  .wallet-input {
    padding: 12px 14px;
    font-size: .875rem;
  }

  .paste-button {
    width: 48px;
    height: 48px;
    font-size: 1.125rem;
  }

  .configured-card {
    padding: 26px 20px;
  }

  .configured-icon {
    width: 68px;
    height: 68px;
    font-size: 2.5rem;
  }

  .configured-title {
    font-size: 1.25rem;
  }

  .configured-details {
    padding: 16px;
  }

  .configured-label {
    font-size: .8125rem;
  }

  .configured-value {
    font-size: .875rem;
  }

  .wallet-notification {
    top: 70px;
  }
}

/* ═══════════════════════════════════════════
   CONFIRMATION POPUP
═══════════════════════════════════════════ */
.confirm-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: fadeIn 0.2s var(--ease);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.confirm-popup {
  background: var(--surface);
  border-radius: 20px;
  padding: 32px 24px 24px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s var(--ease);
  text-align: center;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.confirm-popup-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff8e6 0%, #ffecb3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--c-secondary);
}

.confirm-popup-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--t-dark);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.confirm-popup-message {
  font-size: 0.9375rem;
  color: var(--t-sub);
  line-height: 1.6;
  margin-bottom: 28px;
  font-weight: 500;
}

.confirm-popup-buttons {
  display: flex;
  gap: 12px;
}

.confirm-popup-btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border: none;
  outline: none;
}

.cancel-btn {
  background: var(--bg);
  color: var(--t-main);
  border: 1px solid var(--border2);
}

.cancel-btn:hover {
  background: var(--surface);
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.ok-btn {
  background: linear-gradient(135deg, var(--c-secondary) 0%, var(--c-primary) 100%);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.ok-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(254, 87, 34, 0.35);
}

.confirm-popup-btn:active {
  transform: translateY(0);
}

@media (max-width: 480px) {
  .confirm-popup {
    padding: 28px 20px 20px;
    max-width: 340px;
  }

  .confirm-popup-icon {
    width: 56px;
    height: 56px;
    font-size: 1.75rem;
  }

  .confirm-popup-title {
    font-size: 1.125rem;
  }

  .confirm-popup-message {
    font-size: 0.875rem;
  }

  .confirm-popup-btn {
    padding: 12px 16px;
    font-size: 0.875rem;
  }
}
