:root {
  --page-bg: #f5f7fb;
  --ink: #172033;
  --muted: #657089;
  --brand: #246bfe;
  --panel: #ffffff;
  --line: #e4e9f2;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(90deg, rgb(245 247 251 / 0%), rgb(245 247 251 / 0%)), url(bgimage.png) center / cover fixed no-repeat;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  min-height: 100vh;
}

.modal-content {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.22);
}

.modal.fade .modal-dialog {
  transform: scale(0.88);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.32s ease;
}

.modal.show .modal-dialog {
  transform: scale(1);
}

.scan-entry-modal .modal-content {
  position: relative;
  display: grid;
  min-height: 520px;
  place-items: center;
  padding: 2rem;
  background: transparent;
  box-shadow: none;
}

.scan-entry-modal .modal-dialog {
  max-width: min(94vw, 980px);
}

.background-popup {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: url("modal-bg-1.png") center / cover no-repeat;
  border: 1px solid rgba(223, 231, 243, 0.9);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(23, 32, 51, 0.22);
  opacity: 0;
  transform: scale(0.92);
  animation: backgroundPopupIn 0.36s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.front-popup {
  position: relative;
  z-index: 2;
  width: min(100%, 596px);
  padding: 0.75rem;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.3);
  opacity: 0;
  transform: scale(0.88);
  animation: frontPopupIn 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) 0.32s forwards;
}

@keyframes backgroundPopupIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes frontPopupIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scan-entry-modal .modal-header {
  padding: 0.3rem 0.3rem 0.3rem;
}

.scan-entry-modal .modal-body {
  padding: 1rem 1rem 1rem;
}

.scan-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  font-weight: 700;
}

.result-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.55rem;
  font-weight: 700;
}

.scan-logo {
  width: 25px;
  height: 25px;
  object-fit: contain;
  flex: 0 0 auto;
}

.scan-copy {
  font-size: 1.35rem;
  line-height: 1.5;
}

.scan-warning {
  color: #8a1111;
  background: #ffe1e1;
  border: 1px solid #ffb8b8;
  border-left: 6px solid #dc3545;
  border-radius: 8px;
  padding: 1rem 1.15rem;
  font-weight: 600;
}

.warning-headline {
  color: #dc3545;
  font-size: 1.15rem;
  text-align: center;
  margin-bottom: 0.75rem;
}

.warning-details {
  color: #172033;
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.warning-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0.5rem 0;
}

.warning-icon-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.warning-icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.warning-icon-shield {
  background: #4caf50;
  color: #fff;
  font-size: 1.25rem;
}

.warning-icon-orange {
  background: #ff9800;
}

.warning-icon-blue {
  background: #2196f3;
}

.warning-risk {
  color: #172033;
  font-size: 1.05rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.warning-cta {
  color: #dc3545;
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 0;
}

.warning-cta a {
  color: #1565c0;
  text-decoration: none;
}

.warning-cta a:hover {
  text-decoration: underline;
}

.scan-action {
  min-height: 58px;
  font-size: 1.25rem;
  font-weight: 600;
}

.scan-action i {
  font-size: 1.35rem;
}

.progress {
  height: 1.35rem;
  background: #e9eef8;
}

.progress-bar {
  font-weight: 700;
}

.scan-steps {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0;
}

.scan-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  color: var(--muted);
  background: #f4f7fc;
  border: 1px solid #e1e8f2;
  border-radius: 8px;
  font-size: 0.98rem;
  font-weight: 600;
}

.scan-step i {
  color: #98a4b8;
  font-size: 1.05rem;
}

.scan-step.is-active {
  color: #12305f;
  background: #eaf2ff;
  border-color: #b9d3ff;
}

.scan-step.is-active i {
  color: var(--brand);
}

.scan-step.is-complete {
  color: #146c43;
  background: #e7f6ee;
  border-color: #b7e4ca;
}

.scan-step.is-complete i {
  color: #198754;
}

/* ===== Result Modal: Two-Column Layout ===== */
.result-modal-content {
  overflow: hidden;
  border-radius: 14px;
  padding: 0;
}

.result-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  filter: invert(1);
  opacity: 0.7;
  transition: opacity 0.2s;
}

.result-close-btn:hover {
  opacity: 1;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
}

/* Left Panel */
.result-left {
  background: linear-gradient(145deg, #1a1f36, #2d1b3d);
  color: #ffffff;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.result-left-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.result-heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.support-callout {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.3rem 0.3rem;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.25), rgba(220, 53, 69, 0.12));
  border: 2px solid rgba(220, 53, 69, 0.6);
  border-left: 6px solid #dc3545;
  border-radius: 14px;
  box-shadow: 0 0 20px rgba(220, 53, 69, 0.2), inset 0 0 30px rgba(220, 53, 69, 0.05);
  animation: calloutGlow 2.5s ease-in-out infinite;
}

@keyframes calloutGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.2), inset 0 0 30px rgba(220, 53, 69, 0.05);
  }
  50% {
    box-shadow: 0 0 35px rgba(220, 53, 69, 0.35), inset 0 0 30px rgba(220, 53, 69, 0.08);
  }
}

.support-callout i {
  display: inline-grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #dc3545, #b02a37);
  border: 2px solid #ffffff;
  border-radius: 14px;
  flex: 0 0 auto;
  font-size: 1.6rem;
  box-shadow: 0 4px 14px rgba(220, 53, 69, 0.4);
}

.support-callout span {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.15rem;
}

.support-callout a {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 900;
  text-decoration: none;
  letter-spacing: 0.02em;
  text-shadow: 0 0 18px rgba(255, 107, 107, 0.3);
  /* -webkit-text-stroke: 1px #ffff; */
  transition: color 0.2s, text-shadow 0.2s;
}

.support-callout a:hover {
  color: #ffa0a0;
  text-shadow: 0 0 24px rgba(255, 160, 160, 0.5);
}

/* Threat Card */
.threat-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.25);
  border-radius: 10px;
}

.threat-icon {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  background: rgba(255, 193, 7, 0.2);
  border-radius: 10px;
  flex: 0 0 auto;
}

.threat-icon i {
  color: #ffc107;
  font-size: 1.4rem;
}

.threat-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #ffc107;
  margin: 0 0 0.3rem;
}

.threat-info p {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
  line-height: 1.5;
}

/* Risk List */
.risk-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.risk-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.2);
  border-radius: 8px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.88);
}

.risk-list li i {
  color: #dc3545;
  font-size: 0.9rem;
  flex: 0 0 auto;
}

/* CTA text */
.result-cta-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, rgba(110, 168, 254, 0.15), rgba(110, 168, 254, 0.06));
  border: 1px solid rgba(110, 168, 254, 0.3);
  border-radius: 10px;
  line-height: 1.55;
}

.result-cta-text i {
  color: #6ea8fe;
  margin-right: 0.4rem;
  font-size: 1.1rem;
}

.result-cta-text a {
  color: #79b8ff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
  text-shadow: 0 0 10px rgba(110, 168, 254, 0.3);
  transition: color 0.2s;
}

.result-cta-text a:hover {
  color: #a8d1ff;
  text-decoration: underline;
}

/* Right Panel */
.result-right {
  background: #ffffff;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.35rem;
}

.form-heading i {
  color: var(--brand);
  margin-right: 0.3rem;
}

.form-subtext {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.result-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.result-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.result-form .form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap i {
  position: absolute;
  top: 50%;
  left: 0.85rem;
  transform: translateY(-50%);
  color: #98a4b8;
  font-size: 0.95rem;
  pointer-events: none;
}

.input-icon-wrap .form-control {
  padding-left: 2.5rem;
}

.result-form .form-control {
  border: 1.5px solid #e1e8f2;
  border-radius: 8px;
  padding: 0.7rem 2.9rem;
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.result-form .form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(36, 107, 254, 0.12);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.form-submit-btn {
  flex: 1;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  background: var(--brand);
  border-color: var(--brand);
  transition: background 0.2s, transform 0.15s;
}

.form-submit-btn:hover {
  background: #1a5ae0;
  transform: translateY(-1px);
}

.form-submit-btn:active {
  transform: translateY(0);
}

.form-close-btn {
  min-height: 48px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
  .result-grid {
    grid-template-columns: 1fr;
  }

  .result-left {
    padding: 1.5rem;
  }

  .result-right {
    padding: 1.5rem;
  }

  .result-close-btn {
    filter: none;
  }
}

@media (max-width: 575.98px) {
  body {
    background: linear-gradient(90deg, rgb(245 247 251 / 0%), rgb(245 247 251 / 0%)), url("bgimage-mob.png") center / cover fixed no-repeat;
  }

  .display-5 {
    font-size: 2rem;
  }

  .scan-title {
    font-size: 1.45rem;
  }

  .scan-copy {
    font-size: 1.1rem;
  }

  .scan-action {
    min-height: 54px;
    font-size: 1.1rem;
  }

  .scan-entry-modal .modal-content {
    min-height: 440px;
    padding: 1rem;
  }

  .support-callout a {
    font-size: 1.3rem;
  }

  .result-heading {
    font-size: 1.15rem;
  }

  .form-actions {
    flex-direction: column;
  }
}

/* ===== Spin Animation ===== */
.spin-icon {
  display: inline-block;
  animation: spinIcon 0.8s linear infinite;
}

@keyframes spinIcon {
  to {
    transform: rotate(360deg);
  }
}
.btn-primary {
  background-color: #2196f3;
  border-color: #2196f3;
}

/* ===== Hotline Confirmation Modal ===== */
.hotline-modal-content {
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, #f8faff, #eef3fb);
  border: none;
  box-shadow: 0 28px 80px rgba(23, 32, 51, 0.25);
}

.hotline-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 2rem;
  gap: 0.75rem;
}

.hotline-icon-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.hotline-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.hotline-check i {
  font-size: 2.8rem;
  color: #198754;
  animation: hotlineCheckPop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s both;
}

@keyframes hotlineCheckPop {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.hotline-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.hotline-number {
  display: block;
  font-size: 2.8rem;
  font-weight: 900;
  color: #1565c0;
  text-decoration: none;
  letter-spacing: 0.02em;
  line-height: 1.2;
  transition: color 0.2s;
}

.hotline-number:hover {
  color: #0d47a1;
}

.hotline-subtext {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0.25rem 0 0.5rem;
  max-width: 340px;
}

.hotline-call-btn {
  min-height: 52px;
  min-width: 240px;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: 10px;
  background: #198754;
  border-color: #198754;
  color: #ffffff;
  transition: background 0.2s, transform 0.15s;
  animation: hotlinePulse 2s ease-in-out 1s infinite;
}

.hotline-call-btn:hover {
  background: #146c43;
  color: #ffffff;
  transform: translateY(-2px);
}

.hotline-call-btn:active {
  transform: translateY(0);
}

@keyframes hotlinePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(25, 135, 84, 0);
  }
}

@media (max-width: 575.98px) {
  .hotline-number {
    font-size: 2rem;
  }

  .hotline-title {
    font-size: 1.3rem;
  }

  .hotline-body {
    padding: 2rem 1.25rem;
  }
}