/**
 * NC Phone Buyers — Trade-In Calculator Styles
 * Ported from the React Tailwind design to standalone CSS.
 */

/* ---------- Layout ---------- */
.ncpb-trade-in-wrap {
  padding: 64px 0 96px;
  background: linear-gradient(to bottom, #020617, #0f172a, #020617);
  color: white;
  position: relative;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ncpb-trade-in-wrap *,
.ncpb-trade-in-wrap *::before,
.ncpb-trade-in-wrap *::after {
  box-sizing: border-box;
}

/* Background glow */
.ncpb-trade-in-wrap::before {
  content: '';
  position: absolute;
  top: 33%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
}

/* ---------- Header ---------- */
.ncpb-calc-header {
  text-align: center;
  max-width: 768px;
  margin: 0 auto 48px;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

.ncpb-calc-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.ncpb-calc-title {
  font-size: 2rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  line-height: 1.2;
}

.ncpb-calc-subtitle {
  font-size: 1.1rem;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.6;
}

@media (min-width: 640px) {
  .ncpb-calc-title { font-size: 2.5rem; }
}

@media (min-width: 768px) {
  .ncpb-calc-title { font-size: 3rem; }
  .ncpb-trade-in-wrap { padding: 96px 0; }
}

/* ---------- Grid ---------- */
.ncpb-calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
  z-index: 1;
  align-items: start;
}

@media (min-width: 1024px) {
  .ncpb-calc-grid {
    grid-template-columns: 7fr 5fr;
  }
}

/* ---------- Left Panel ---------- */
.ncpb-calc-left {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #1e293b;
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 640px) {
  .ncpb-calc-left { padding: 32px; }
}

.ncpb-calc-step {}

.ncpb-step-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

/* ---------- Brand Buttons ---------- */
.ncpb-brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ncpb-brand-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(51, 65, 85, 0.8);
  background: rgba(30, 41, 59, 0.6);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
}

.ncpb-brand-btn:hover {
  background: #1e293b;
  color: white;
}

.ncpb-brand-btn.active {
  background: rgba(37, 99, 235, 0.2);
  border-color: #3b82f6;
  color: white;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
  transform: scale(1.02);
}

.ncpb-brand-btn.active .ncpb-brand-icon {
  fill: #60a5fa;
}

.ncpb-brand-icon {
  width: 28px;
  height: 28px;
  fill: currentColor;
  margin-bottom: 8px;
}

/* ---------- Search ---------- */
.ncpb-search-wrap {
  position: relative !important;
  width: 100% !important;
  margin-bottom: 12px !important;
  box-sizing: border-box !important;
}

.ncpb-search-icon {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 18px !important;
  height: 18px !important;
  color: #94a3b8 !important;
  stroke: #94a3b8 !important;
  pointer-events: none !important;
  z-index: 2 !important;
}

.ncpb-search-input,
#ncpb-trade-in-calculator input[type="text"].ncpb-search-input,
#ncpb-trade-in-calculator input.ncpb-search-input,
#ncpb-device-search {
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  padding: 10px 16px 10px 42px !important;
  background-color: #1e293b !important;
  background: rgba(30, 41, 59, 0.9) !important;
  border: 1px solid #334155 !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  color: #ffffff !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

.ncpb-search-input::placeholder,
#ncpb-trade-in-calculator input[type="text"].ncpb-search-input::placeholder,
#ncpb-device-search::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
}

.ncpb-search-input:focus,
#ncpb-trade-in-calculator input[type="text"].ncpb-search-input:focus,
#ncpb-device-search:focus {
  outline: none !important;
  background-color: #1e293b !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35) !important;
  color: #ffffff !important;
}

/* ---------- Select ---------- */
.ncpb-select,
#ncpb-trade-in-calculator select.ncpb-select,
#ncpb-trade-in-calculator select,
#ncpb-device-select,
#ncpb-storage-select,
#ncpb-carrier-select {
  width: 100% !important;
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  line-height: 1.5 !important;
  box-sizing: border-box !important;
  padding: 12px 42px 12px 16px !important;
  background-color: #1e293b !important;
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  border-radius: 12px !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  font-family: inherit !important;
  cursor: pointer !important;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  background-size: 16px 16px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

.ncpb-select:focus,
#ncpb-trade-in-calculator select.ncpb-select:focus,
#ncpb-device-select:focus,
#ncpb-storage-select:focus,
#ncpb-carrier-select:focus {
  outline: none !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35) !important;
}

.ncpb-select option,
#ncpb-trade-in-calculator select.ncpb-select option,
#ncpb-trade-in-calculator select option,
#ncpb-device-select option,
#ncpb-storage-select option,
#ncpb-carrier-select option {
  background-color: #0f172a !important;
  background: #0f172a !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  padding: 12px 16px !important;
}

.ncpb-select option:checked,
#ncpb-trade-in-calculator select.ncpb-select option:checked {
  background-color: #1e3a5f !important;
  color: #38bdf8 !important;
  font-weight: 700 !important;
}

/* ---------- Row (Storage + Carrier) ---------- */
.ncpb-calc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 639px) {
  .ncpb-calc-row { grid-template-columns: 1fr; }
}

/* ---------- Condition Buttons ---------- */
.ncpb-condition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ncpb-condition-btn {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #334155;
  background: rgba(30, 41, 59, 0.6);
  color: #94a3b8;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.ncpb-condition-btn:hover {
  background: #1e293b;
  color: white;
}

.ncpb-condition-btn.active {
  background: rgba(37, 99, 235, 0.2);
  border-color: #3b82f6;
  color: white;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
}

.ncpb-cond-label {
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
  margin-bottom: 2px;
}

.ncpb-cond-desc {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ---------- Right Panel (Quote Card) ---------- */
.ncpb-calc-right {}

.ncpb-quote-card {
  background: linear-gradient(to bottom, #0f172a, #1e293b, #0f172a);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 480px;
}

@media (min-width: 640px) {
  .ncpb-quote-card { padding: 32px; }
}

.ncpb-quote-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(51, 65, 85, 0.8);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.ncpb-quote-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #60a5fa;
}

.ncpb-live-badge {
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Specs summary */
.ncpb-quote-specs {
  background: rgba(2, 6, 23, 0.6);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #1e293b;
  margin-bottom: 24px;
}

.ncpb-quote-device {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}

.ncpb-quote-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ncpb-tag {
  display: inline-block;
  padding: 4px 8px;
  background: #1e293b;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #cbd5e1;
}

/* Price box */
.ncpb-quote-price-box {
  text-align: center;
  padding: 16px;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  margin-bottom: 24px;
}

.ncpb-price-label {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.ncpb-price-value {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(to right, #60a5fa, #67e8f9, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .ncpb-price-value { font-size: 3rem; }
}

.ncpb-price-note {
  font-size: 0.75rem;
  color: #34d399;
  font-weight: 500;
  margin-top: 8px;
}

/* Trust items */
.ncpb-quote-trust {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

.ncpb-trust-item {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.ncpb-check-icon {
  width: 20px;
  height: 20px;
  color: #34d399;
  flex-shrink: 0;
  margin-right: 8px;
}

/* Accept CTA */
.ncpb-accept-btn {
  width: 100%;
  padding: 16px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  background: linear-gradient(to right, #2563eb, #06b6d4);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.25);
  font-family: inherit;
}

.ncpb-accept-btn:hover:not(:disabled) {
  background: linear-gradient(to right, #3b82f6, #22d3ee);
  transform: scale(1.02);
}

.ncpb-accept-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.ncpb-accept-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Modal ---------- */
.ncpb-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(12px);
  overflow-y: auto;
}

.ncpb-modal-content {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  margin: 32px 0;
}

@media (min-width: 640px) {
  .ncpb-modal-content { padding: 32px; }
}

.ncpb-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}

.ncpb-modal-close:hover {
  background: #1e293b;
  color: white;
}

/* Modal header */
.ncpb-modal-header {
  border-bottom: 1px solid #1e293b;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.ncpb-modal-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin: 0;
}

.ncpb-modal-sub {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 4px 0 0;
}

.ncpb-modal-sub span {
  color: #60a5fa;
  font-weight: 600;
}

/* Form inside modal */
.ncpb-claim-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ncpb-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 639px) {
  .ncpb-form-row { grid-template-columns: 1fr; }
}

.ncpb-form-group {
  display: flex;
  flex-direction: column;
}

.ncpb-form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 4px;
}

.ncpb-form-group input,
.ncpb-form-group select,
.ncpb-form-group textarea,
#ncpb-claim-modal input,
#ncpb-claim-modal select,
#ncpb-claim-modal textarea {
  width: 100% !important;
  padding: 10px 14px !important;
  background-color: #1e293b !important;
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  border-radius: 12px !important;
  font-size: 0.875rem !important;
  color: #ffffff !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
  transition: border-color 0.2s !important;
}

.ncpb-form-group input::placeholder,
.ncpb-form-group textarea::placeholder,
#ncpb-claim-modal input::placeholder,
#ncpb-claim-modal textarea::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}

.ncpb-form-group input:focus,
.ncpb-form-group select:focus,
.ncpb-form-group textarea:focus,
#ncpb-claim-modal input:focus,
#ncpb-claim-modal select:focus,
#ncpb-claim-modal textarea:focus {
  outline: none !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
}

.ncpb-form-group select {
  cursor: pointer;
}

.ncpb-form-group textarea {
  resize: vertical;
}

.ncpb-submit-btn {
  width: 100%;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
  background: linear-gradient(to right, #059669, #0d9488);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.25);
  font-family: inherit;
  margin-top: 16px;
}

.ncpb-submit-btn:hover:not(:disabled) {
  background: linear-gradient(to right, #10b981, #14b8a6);
}

.ncpb-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal success */
.ncpb-modal-success {
  text-align: center;
  padding: 32px 0;
}

.ncpb-success-icon {
  width: 64px;
  height: 64px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 16px;
}

.ncpb-modal-success h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin: 0 0 8px;
}

.ncpb-modal-success p {
  color: #cbd5e1;
  font-size: 0.875rem;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.5;
}

.ncpb-btn-done {
  margin-top: 24px;
  background: #2563eb;
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.ncpb-btn-done:hover {
  background: #3b82f6;
}
