:root {
  --bg: #F2F4F5;
  --white: #FFFFFF;
  --text-dark: #191B1D;
  --text-body: #606162;
  --text-muted: #ADB0B1;
  --border: #E0E1E2;
  --blue: #0067FF;
  --blue-hover: #0053CC;
  --green: #009E5E;
  --red: #E94E4E;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ===== NAVBAR ===== */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  color: var(--text-dark);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}

.nav-links a:hover {
  background-color: #F2F4F5;
}

.hamburger {
  display: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-dark);
}

.nav-search {
  flex: 1;
  max-width: 400px;
  margin: 0 24px;
}

.search-pill {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  height: 36px;
}

.search-pill i {
  color: var(--text-muted);
  font-size: 14px;
  margin-right: 8px;
}

.search-pill input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-dark);
  outline: none;
  font-family: inherit;
}

.nav-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-login {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dark);
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-signup {
  background: var(--blue);
  border: none;
  color: white;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.mobile-menu {
  display: none;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.mobile-menu.active { display: block; }

.mobile-menu a {
  display: block;
  padding: 14px 24px;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

/* ===== PAGE ===== */
.page-bg {
  flex: 1;
  padding: 48px 24px;
}

.page-container {
  max-width: 520px;
  margin: 0 auto;
}

.redeem-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.redeem-box h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.subtitle {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.5;
  margin-bottom: 24px;
}

.step {
  display: none;
}

.step.active {
  display: block;
  animation: fadeUp 0.25s ease;
}

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

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rbx-input {
  width: 100%;
  height: 44px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-dark);
  font-family: inherit;
  outline: none;
  transition: border 0.15s;
}

.rbx-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 103, 255, 0.15);
}

.rbx-select {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23606162' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.btn-redeem {
  width: 100%;
  height: 44px;
  background-color: var(--blue);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  margin-top: 8px;
}

.btn-redeem:hover { background-color: var(--blue-hover); }

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

.btn-back {
  height: 44px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-back:hover { background-color: var(--bg); }

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-row .btn-redeem { flex: 1; margin-top: 0; }

/* ===== ACCOUNT FOUND BAR ===== */
.user-found-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #E8F7F0;
  border: 1px solid #B8E4D0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--green);
  font-weight: 500;
}

.user-found-bar strong {
  color: var(--text-dark);
}

/* ===== VALUE CARDS ===== */
.value-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.value-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}

.value-card:hover {
  border-color: #999;
}

.value-card.selected {
  border-color: #E94E4E;
  background: #FFF0F0;
}

.value-card.selected .val-amount {
  color: #E94E4E;
}

.value-card.selected .val-label {
  color: #E94E4E;
}

.val-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
}

.val-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 2px;
}

.value-card.featured {
  border-color: var(--blue);
}

.featured-tag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
  text-transform: uppercase;
}

/* ===== PROCESSING ===== */
.process-spinner {
  margin: 30px 0;
}

.official-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

.process-steps {
  max-width: 320px;
  margin: 0 auto;
  text-align: left;
}

.p-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s;
}

.p-step:last-child { border-bottom: none; }

.p-step.active {
  color: var(--text-dark);
  font-weight: 600;
}

.p-step.active i {
  color: var(--blue);
}

.p-step.done {
  color: var(--green);
}

.p-step.done i {
  color: var(--green);
}

.p-step.fail {
  color: var(--red);
}

.p-step.fail i {
  color: var(--red);
}

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.active { display: flex; }

.modal-box {
  background: var(--white);
  width: 90%;
  max-width: 440px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
}

.modal-top i {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
}

.modal-inner {
  padding: 24px 20px;
  text-align: center;
}

.modal-shield {
  width: 56px;
  height: 56px;
  background: #F0F6FF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.modal-shield i {
  font-size: 24px;
  color: var(--blue);
}

.modal-inner h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.modal-text {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.5;
  margin-bottom: 16px;
}

.modal-task-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FFF8E6;
  border: 1px solid #FFE4A0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: #8A6D00;
  text-align: left;
  margin-bottom: 20px;
}

.modal-task-info i {
  margin-top: 2px;
  color: #C09200;
}

/* ===== OFFERS ===== */
.offer-list-official {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.offer-item {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  text-decoration: none;
  transition: all 0.15s;
}

.offer-item:hover {
  border-color: var(--blue);
  background: #F0F6FF;
}

.offer-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  margin-right: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.offer-details {
  flex: 1;
  min-width: 0;
}

.offer-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 2px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.offer-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.offer-get-btn {
  background: var(--blue);
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 8px;
}

.modal-secure {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.modal-secure i {
  margin-right: 4px;
}

/* ===== FOOTER ===== */
.rbx-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--text-body);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.footer-links a:hover { text-decoration: underline; }

.copyright {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ===== TOAST ===== */
.toast-notification {
  position: fixed;
  bottom: -100px;
  left: 24px;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 100;
  transition: bottom 0.4s ease;
  max-width: 300px;
}

.toast-notification.show { bottom: 24px; }

.toast-text {
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.4;
}

.toast-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links, .nav-search { display: none; }
  .hamburger { display: block; }
  .value-grid { grid-template-columns: 1fr; }
  .page-bg { padding: 24px 16px; }
  .redeem-box { padding: 24px 20px; }
  .toast-notification { left: 16px; right: 16px; max-width: none; }
}
