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

body {
  font-family: "Tajawal", system-ui, sans-serif;
  direction: rtl;
  text-align: right;
  background: #f8fafc;
  color: #0f172a;
  min-height: 100vh;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font-family: inherit;
}

#app {
  min-height: 100vh;
}

.loading-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #64748b;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---- Loyalty card page ---- */

.loyalty-main {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 40%, #1e3a8a 100%);
  padding: 32px 16px;
}

.loyalty-container {
  max-width: 28rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.loyalty-header {
  text-align: center;
  color: #fff;
}

.loyalty-header h1 {
  font-size: 1.25rem;
  font-weight: 800;
}

.loyalty-header p {
  margin-top: 4px;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.card-card {
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-top .name-wrap p:first-child {
  font-weight: 500;
  color: #0f172a;
}

.card-top .name-wrap p:last-child {
  font-size: 0.75rem;
  color: #94a3b8;
}

.tier-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.875rem;
  font-weight: 700;
}

.points-wrap {
  margin-top: 24px;
  text-align: center;
}

.points-wrap .points-label {
  font-size: 0.875rem;
  color: #64748b;
}

.points-wrap .points-value {
  font-size: 3rem;
  font-weight: 800;
  color: #0f172a;
}

.tier-progress {
  margin-top: 24px;
}

.tier-progress .row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.tier-progress .row .label {
  color: #64748b;
}

.tier-progress .bar {
  height: 12px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.tier-progress .bar-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.tier-progress .hint {
  margin-top: 8px;
  font-size: 0.875rem;
  color: #475569;
}

.stats-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.stat-box .stat-label {
  font-size: 0.875rem;
  color: #64748b;
}

.stat-box .stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 2px;
}

.section-title {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.list-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.list-item + .list-item {
  border-top: 1px solid #f1f5f9;
}

.list-item .min-w-0 {
  flex: 1;
  min-width: 0;
}

.list-item .item-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item .item-sub {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 2px;
}

.list-item .item-action {
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 700;
  color: #334155;
}

.list-item .item-plus {
  white-space: nowrap;
  font-weight: 700;
  color: #059669;
}

.list-item .item-minus {
  white-space: nowrap;
  font-weight: 700;
  color: #dc2626;
}

.reward-chip {
  white-space: nowrap;
  background: #ecfdf5;
  color: #047857;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.875rem;
  font-weight: 700;
}

.copy-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
}

.copy-field {
  width: 100%;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: #fff;
  color: #0f172a;
  direction: ltr;
}

.copy-field.copied {
  border-color: #6ee7b7;
  background: #ecfdf5;
  color: #047857;
}

.copy-card .copy-hint {
  margin-top: 12px;
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
}

.btn-copy {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
  transition: all 0.15s ease;
}

.btn-copy:hover {
  background: #f8fafc;
}

.btn-primary {
  display: inline-block;
  width: 100%;
  border: none;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  padding: 12px 24px;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-primary:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

.loyalty-footer {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  padding-bottom: 16px;
}

/* ---- Review page ---- */

.review-main,
.join-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: 48px 16px;
}

.review-container,
.join-container {
  width: 100%;
  max-width: 36rem;
}

.review-card,
.join-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  padding: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.review-heading,
.join-heading {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.review-heading h1,
.join-heading h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.review-heading p,
.join-heading p {
  margin-top: 8px;
  font-size: 0.875rem;
  color: #64748b;
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 6px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.875rem;
  outline: none;
  background: #fff;
  color: #0f172a;
  transition: border-color 0.15s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-field .hint {
  margin-top: 4px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.error-text {
  font-size: 0.875rem;
  color: #dc2626;
  margin-top: 8px;
}

.success-box {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.success-box h2 {
  color: #065f46;
  font-size: 1.125rem;
  font-weight: 700;
}

.success-box p {
  color: #047857;
  font-size: 0.875rem;
  margin-top: 8px;
}

.success-box .btn {
  margin-top: 16px;
  display: inline-block;
  background: #059669;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 24px;
  font-size: 0.875rem;
  font-weight: 600;
}

.not-found {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.not-found .card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  max-width: 24rem;
}

.not-found h1 {
  font-size: 1.25rem;
  color: #0f172a;
}

.not-found p {
  margin-top: 8px;
  color: #64748b;
  font-size: 0.875rem;
}

/* ---- Stars ---- */

.stars {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.star-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #94a3b8;
  font-size: 1.125rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.star-btn.active {
  border-color: #fcd34d;
  background: #fef3c7;
  color: #b45309;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  padding: 6px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.chip-btn.active {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

@media (max-width: 480px) {
  .review-card,
  .join-card {
    padding: 24px 20px;
  }
}