/* ================================================================
   Contractor Rewards Plugin — Main Stylesheet v2.0
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── GLOBAL RESET for plugin buttons ────────────────────────────── */
.crc-btn,
.crc-btn:hover,
.crc-btn:focus,
.crc-btn:active,
button.crc-btn,
input.crc-btn,
a.crc-btn {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
}

.crc-primary-btn,
.crc-primary-btn:hover,
.crc-primary-btn:focus,
.crc-primary-btn:active,
button.crc-primary-btn {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
}

/* ── Splash Screen ─────────────────────────────────────────────── */
#crc-splash-screen {
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#crc-splash-screen.crc-splash-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.crc-splash-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 12px 36px rgba(229, 57, 53, 0.18);
  animation: crcSplashPop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.crc-splash-name {
  margin-top: 18px;
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.5px;
  animation: crcSplashFadeUp 0.55s 0.25s ease both;
}

.crc-splash-tagline {
  margin-top: 5px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #9ca3af;
  animation: crcSplashFadeUp 0.55s 0.38s ease both;
}

.crc-splash-loader {
  margin-top: 48px;
  width: 120px;
  height: 3px;
  background: #f3f4f6;
  border-radius: 99px;
  overflow: hidden;
  animation: crcSplashFadeUp 0.55s 0.5s ease both;
}

.crc-splash-loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #E53935, #ef5350);
  border-radius: 99px;
  animation: crcLoaderFill 1.8s 0.55s ease-out both;
}

@keyframes crcSplashPop {
  from {
    transform: scale(0.7);
    opacity: 0
  }

  to {
    transform: scale(1);
    opacity: 1
  }
}

@keyframes crcSplashFadeUp {
  from {
    transform: translateY(14px);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}

@keyframes crcLoaderFill {
  from {
    width: 0%
  }

  to {
    width: 100%
  }
}

/* ── Auth Pages ────────────────────────────────────────────────── */
.crc-auth-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #fff5f5 0%, #ffffff 55%, #ffeaea 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 36px;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, sans-serif;
}

.crc-auth-wrapper {
  width: 100%;
  max-width: 420px;
}

.crc-brand {
  text-align: center;
  margin-bottom: 26px;
}

.crc-brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(229, 57, 53, 0.22);
  display: block;
  margin: 0 auto 12px;
}

.crc-brand-name {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.4px;
}

.crc-brand-tagline {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 3px;
}

.crc-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 30px 26px 28px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08), 0 4px 14px rgba(229, 57, 53, 0.05);
  border: 1px solid rgba(229, 57, 53, 0.07);
}

.crc-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 5px;
  letter-spacing: -0.4px;
}

.crc-sub {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 22px;
  line-height: 1.55;
}

.crc-input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  font-size: 15px;
  margin-bottom: 10px;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-family: inherit;
  color: #111827;
}

.crc-input::placeholder {
  color: #9ca3af;
}

.crc-input:focus {
  border-color: #E53935;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.08);
}

.crc-auth-page .crc-btn,
.crc-auth-page button.crc-btn,
.crc-auth-page input[type="submit"].crc-btn {
  width: 100%;
  padding: 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #E53935 0%, #c62828 100%) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 4px 16px rgba(229, 57, 53, 0.36);
  transition: transform .12s ease, box-shadow .12s ease;
  font-family: inherit;
  display: block;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
}

.crc-auth-page .crc-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(229, 57, 53, 0.44);
}

.crc-auth-page .crc-btn:active:not(:disabled) {
  transform: translateY(0);
}

.crc-auth-page .crc-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.crc-btn {
  width: 100%;
  padding: 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #E53935 0%, #c62828 100%);
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 4px 16px rgba(229, 57, 53, 0.36);
  transition: transform .12s ease, box-shadow .12s ease;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.crc-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(229, 57, 53, 0.44);
}

.crc-btn:active:not(:disabled) {
  transform: translateY(0);
}

.crc-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.crc-link {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: #E53935;
  cursor: pointer;
  font-weight: 500;
}

.crc-link:hover {
  opacity: 0.75;
}

.crc-msg {
  margin-top: 10px;
  padding: 11px 13px;
  font-size: 13px;
  border-radius: 10px;
  display: none;
  line-height: 1.5;
}

.crc-msg.error {
  background: #fef2f2;
  color: #b91c1c;
  border-left: 3px solid #ef4444;
}

.crc-msg.success {
  background: #f0fdf4;
  color: #166534;
  border-left: 3px solid #22c55e;
}

.crc-deleted-banner {
  background: #fef2f2;
  color: #991b1b;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  border-left: 4px solid #ef4444;
  text-align: center;
  line-height: 1.5;
}

/* ── Dashboard App Shell ───────────────────────────────────────── */
.crc-app-root {
  min-height: 100vh;
  background: #f5f6fa;
  display: flex;
  justify-content: center;
  padding: 0 0 96px;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, sans-serif;
}

.crc-app-shell {
  width: 100%;
  max-width: 480px;
}

.crc-card-main {
  background: #fff;
  padding: 20px 16px 20px;
}

/* ★ FIXED: Dashboard header — hamburger now lives inside ★ */
.crc-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 16px;
  background: linear-gradient(135deg, #E53935 0%, #c62828 100%);
  margin: -20px -16px 16px;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 4px 20px rgba(229, 57, 53, 0.28);
  position: relative;
}

.crc-dash-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crc-dash-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
}

.crc-dash-hello {
  font-size: 16px;
  font-weight: 700;
  color: #fff !important;
}

.crc-dash-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78) !important;
  margin-top: 1px;
}

/* Hamburger inside header */
#crc-hamburger {
  padding: 8px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

#crc-hamburger:hover {
  background: rgba(255, 255, 255, 0.32);
}

/* ★ FIXED Dropdown menu ★ */
#crc-menu-dropdown {
  display: none;
  position: fixed;
  /* fixed so it doesn't clip inside overflow:hidden parents */
  z-index: 999999;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 8px;
  min-width: 210px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  animation: crcDropIn 0.18s ease;
}

#crc-menu-dropdown button:hover,
#crc-menu-dropdown a:hover {
  background: #f9fafb !important;
}

@keyframes crcDropIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Dropdown menu items */
.crc-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  box-sizing: border-box;
  color: #111827;
}

.crc-dropdown-item img {
  width: 20px;
  height: 20px;
  opacity: 0.65;
  flex-shrink: 0;
}

.crc-dropdown-item span {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
}

.crc-dropdown-item:hover {
  background: #f3f4f6;
}

.crc-dropdown-danger {
  color: #dc2626;
}

.crc-dropdown-danger span {
  color: #dc2626;
  font-weight: 600;
}

.crc-dropdown-danger:hover {
  background: #fef2f2 !important;
}

.crc-dropdown-divider {
  height: 1px;
  background: #fee2e2;
  margin: 5px 8px;
}

/* Balance card */
.crc-balance-card {
  margin-top: 4px;
  border-radius: 18px;
  padding: 18px 16px 14px;
  background: linear-gradient(135deg, #fff5f5, #fff0f0);
  border: 1px solid rgba(229, 57, 53, 0.12);
}

.crc-balance-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.crc-balance-value {
  font-size: 32px;
  font-weight: 800;
  color: #111827;
  margin-top: 4px;
  letter-spacing: -1px;
}

.crc-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

/* Tabs */
#crc-tab-container {
  margin-top: 14px;
}

.crc-section {
  border-radius: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 16px;
  margin-bottom: 10px;
}

.crc-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.crc-section-sub {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 10px;
  line-height: 1.5;
}

.crc-input.dash {
  background: #fff;
  margin-bottom: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

.crc-primary-btn {
  width: 100%;
  padding: 12px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #E53935, #c62828) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.28);
  transition: transform .12s, box-shadow .12s;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.crc-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(229, 57, 53, 0.36);
}

.crc-secondary-btn {
  width: 100%;
  padding: 12px;
  border-radius: 999px;
  border: none;
  background: #111827;
  color: #fff !important;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin-top: 6px;
  font-family: inherit;
  transition: background .15s;
}

.crc-secondary-btn:hover {
  background: #1f2937;
}

.crc-link-btn {
  margin-top: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 500;
}

.crc-status {
  margin-top: 10px;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #111827;
  line-height: 1.5;
}

.crc-status--muted {
  background: #f9fafb;
  color: #6b7280;
}

.crc-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.crc-form-msg {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
}

.crc-slide-wrapper {
  display: flex;
  transition: transform 0.5s ease;
}

.crc-slide {
  min-width: 100%;
  box-sizing: border-box;
}

.crc-dots {
  display: none !important;
}

/* Feature grid */
.crc-feature-grid-wrapper {
  margin-top: 16px;
  background: #fff;
  padding: 18px 10px;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid #f3f4f6;
}

.crc-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
}

.crc-grid-item {
  cursor: pointer;
  padding: 10px 6px;
  border-radius: 14px;
  transition: background .2s, transform .15s;
}

.crc-grid-item:hover {
  background: #fff5f5;
  transform: translateY(-2px);
}

.crc-grid-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.crc-grid-item div {
  font-size: 12px;
  margin-top: 6px;
  color: #374151;
  font-weight: 500;
}

/* ================================================================
   ★ FIXED BOTTOM NAVIGATION BAR
   ================================================================ */

.crc-bottom-wrapper {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  pointer-events: none;
}

.crc-bottom-bar {
  pointer-events: all;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  height: 64px;
  background: #ffffff;
  border-top: 1px solid #f0f0f0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.09);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  box-sizing: border-box;
}

/* Each nav button */
.crc-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none !important;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  height: 100%;
  position: relative;
  -webkit-appearance: none;
  transition: transform 0.15s;
}

.crc-nav-btn:active {
  transform: scale(0.92);
}

.crc-nav-btn img {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  transition: opacity .2s, transform .2s, filter .2s;
  /* Added filter transition */
  opacity: 0.45;
  filter: grayscale(100%);
  /* Default grayscale */
}

.crc-nav-btn.active img {
  opacity: 1;
  transform: scale(1.1);
  filter: grayscale(0%) brightness(0) saturate(100%) invert(27%) sepia(98%) saturate(3527%) hue-rotate(347deg) brightness(91%) contrast(88%);
  /* Red color filter for #E53935 */
}

.crc-nav-btn span {
  font-size: 10px;
  font-weight: 500;
  color: #9ca3af;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  transition: color .2s, font-weight .2s;
  line-height: 1;
}

.crc-nav-btn.active span {
  color: #E53935;
  font-weight: 700;
}

/* No active dot indicator — clean look */

/* Center placeholder */
.crc-scan-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding-bottom: 7px;
  height: 100%;
}

.crc-scan-placeholder span {
  font-size: 10px;
  font-weight: 700;
  color: #E53935;
  font-family: 'Inter', sans-serif;
}

/* ★ FIXED: Circular floating scan button ★ */
.crc-scan-float {
  pointer-events: all;
  position: absolute;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.crc-scan-btn,
button.crc-scan-btn,
.crc-scan-float .crc-scan-btn,
.crc-scan-float button {
  /* Perfect circle with maximum specificity */
  width: 62px !important;
  height: 62px !important;
  min-width: 62px !important;
  min-height: 62px !important;
  max-width: 62px !important;
  max-height: 62px !important;
  border-radius: 50% !important;
  -webkit-border-radius: 50% !important;
  -moz-border-radius: 50% !important;
  border: none !important;
  background: linear-gradient(135deg, #E53935 0%, #c62828 100%) !important;
  box-shadow: 0 0 0 4px #ffffff, 0 6px 24px rgba(229, 57, 53, 0.55) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  cursor: pointer !important;
  transition: transform .18s ease, box-shadow .18s ease !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  position: relative !important;
}

.crc-scan-btn:hover,
button.crc-scan-btn:hover {
  transform: scale(1.1) translateY(-2px) !important;
  box-shadow: 0 0 0 4px #ffffff, 0 10px 30px rgba(229, 57, 53, 0.65) !important;
}


.crc-scan-btn:active,
button.crc-scan-btn:active {
  transform: scale(0.94) !important;
  box-shadow: 0 0 0 4px #ffffff, 0 3px 12px rgba(229, 57, 53, 0.40) !important;
}

.crc-scan-btn img,
button.crc-scan-btn img {
  width: 28px !important;
  height: 28px !important;
  filter: brightness(0) invert(1) !important;
  display: block !important;
}

/* Modal animation */
@keyframes crcModalIn {
  from {
    transform: scale(0.92) translateY(16px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 380px) {
  .crc-bottom-bar {
    height: 58px;
  }

  .crc-nav-btn span {
    font-size: 9px;
  }

  .crc-scan-btn,
  button.crc-scan-btn,
  .crc-scan-float .crc-scan-btn,
  .crc-scan-float button {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
  }

  .crc-scan-float {
    bottom: 34px;
  }
}