:root {
  --primary: #E63946;
  --primary-hover: #D62839;
  --secondary: #0041B4;
  --bg-color: #F4F6F9;
  --card-bg: #FFFFFF;
  --text-main: #1D2D44;
  --text-muted: #6C757D;
  --border-color: #E2E8F0;
  --success: #2A9D8F;
  --error: #E76F51;
  --radius: 16px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.container {
  width: 100%;
  max-width: 440px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.header {
  text-align: center;
  margin-bottom: 24px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(230, 57, 70, 0.1);
  color: var(--primary);
  border-radius: 50%;
  font-size: 28px;
  margin-bottom: 12px;
}

.title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

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

.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  outline: none;
  transition: all 0.2s ease;
  background: #FAFAFA;
}

input:focus {
  border-color: var(--primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
}

.code-input {
  font-family: "Courier New", monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--secondary);
}

.btn-scan {
  position: absolute;
  right: 8px;
  background: #EEF2F6;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
  transition: background 0.2s;
}

.btn-scan:hover {
  background: #E2E8F0;
}

.btn-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.25);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(230, 57, 70, 0.35);
}

.btn-submit:active {
  transform: translateY(1px);
}

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

/* Status Notifications */
.alert {
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 13px;
  display: none;
  line-height: 1.4;
}

.alert-success {
  background: #E8F8F5;
  color: #117A65;
  border: 1px solid #A3E4D7;
}

.alert-error {
  background: #FDEDEC;
  color: #922B21;
  border: 1px solid #FADBD8;
}

/* Success Celebration Modal / Card */
.receipt-card {
  display: none;
  background: #F8FAFC;
  border: 1.5px dashed var(--success);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-top: 18px;
}

.receipt-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.receipt-reward {
  font-size: 26px;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 4px;
}

.receipt-msg {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.receipt-details {
  background: #FFFFFF;
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  color: var(--text-main);
  text-align: left;
  border: 1px solid var(--border-color);
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.receipt-row:last-child {
  margin-bottom: 0;
}

/* QR Scanner Modal */
.scanner-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.scanner-box {
  width: 100%;
  max-width: 380px;
  background: #FFFFFF;
  border-radius: var(--radius);
  overflow: hidden;
  padding: 16px;
  text-align: center;
}

.scanner-video {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.btn-close-scanner {
  margin-top: 12px;
  background: #E2E8F0;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-weight: 600;
  cursor: pointer;
}

.footer {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}
