/* ================================================
   Bank Gresik — Global Styles
   Sistem Penilaian Layanan
   ================================================ */

/* ── Reset & Base ─────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", sans-serif;
  background: url("../assets/BG2.png") center/cover no-repeat fixed;
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ── Design Tokens ────────────────────────────── */
:root {
  /* brand */
  --brand-900: #0b1a42;
  --brand-700: #1d4ed8;
  --brand-100: #dbeafe;
  --brand-50: #eff6ff;

  /* greens (sukses) */
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --green-700: #15803d;

  /* slate */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;

  /* amber (peringatan) */
  --amber-100: #fef3c7;
  --amber-800: #92400e;

  /* red (error) */
  --red-100: #fee2e2;
  --red-700: #b91c1c;
  --red-800: #991b1b;

  /* layout */
  --bg-page: #f1f5f9;
  --radius-sm: 0.375rem; /* 6 px  */
  --radius-md: 0.75rem; /* 12 px */
  --radius-lg: 1rem; /* 16 px */
  --radius-xl: 1.25rem; /* 20 px */
  --radius-pill: 9999px;

  /* shadow */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.07);
  --shadow-up: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-brand: 0 4px 14px rgba(30, 58, 138, 0.35);

  /* anim */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ── Top Bar ──────────────────────────────────── */
.topbar {
  background: var(--brand-900);
  color: #fff;
  padding: 0.75rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.topbar__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.topbar__logo {
  width: 2rem;
  height: 2rem;
  display: block;
  object-fit: contain;
  /* background: rgba(255, 255, 255, 0.12); */
  /* border: 2px solid rgba(255, 255, 255, 0.25); */
  /* border-radius: var(--radius-md); */
  padding: 0.15rem;
}

.topbar__name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.topbar__label {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.75;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
}

/* ── Page Wrapper ─────────────────────────────── */
.page {
  min-height: calc(100vh - 50px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  /* background: linear-gradient(
    145deg,
    var(--slate-100) 0%,
    var(--brand-50) 50%,
    var(--slate-100) 100%
  ); */
}

/* ── Logo Container ───────────────────────────── */
.page__logo {
  text-align: center;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.6s var(--ease-out) both;
}

.page__logo img {
  width: 120px;
  height: auto;
  display: inline-block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
  transition:
    transform 0.3s var(--ease-spring),
    filter 0.3s;
  animation: logoFloat 3s ease-in-out infinite;
}

.page__logo img:hover {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 8px 20px rgba(30, 58, 138, 0.3));
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.page--top {
  justify-content: flex-start;
  padding-top: 2rem;
}

.page__inner {
  width: 100%;
  max-width: 680px;
}

/* ── Progress Indicator ──────────────────────── */
.progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.75rem;
}

.progress__dot {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  background: #fff;
  color: var(--slate-400);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition:
    background 0.4s var(--ease-out),
    color 0.4s var(--ease-out),
    transform 0.4s var(--ease-spring),
    box-shadow 0.3s;
  position: relative;
  z-index: 2;
}

.progress__dot--active {
  background: var(--brand-900);
  color: #fff;
  transform: scale(1.12);
  box-shadow: var(--shadow-brand);
}

.progress__line {
  width: 3rem;
  height: 3px;
  background: var(--slate-200);
  border-radius: 2px;
  transition: background 0.5s var(--ease-out);
}

.progress__line--active {
  background: var(--brand-900);
}

/* ── Card ─────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

/* dekoratif */
.card::before {
  content: "";
  position: absolute;
  top: -4rem;
  right: -4rem;
  width: 14rem;
  height: 14rem;
  background: radial-gradient(circle, var(--brand-100) 0%, transparent 70%);
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}

.card::after {
  content: "";
  position: absolute;
  bottom: -3rem;
  left: -3rem;
  width: 10rem;
  height: 10rem;
  background: radial-gradient(circle, var(--slate-100) 0%, transparent 70%);
  pointer-events: none;
  animation: float 6s ease-in-out infinite reverse;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(10px, 10px) scale(1.05);
  }
}

.card__body {
  position: relative;
  z-index: 1;
}

/* ── Typography helpers ──────────────────────── */
.title {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 0.25rem;
  animation: slideInDown 0.6s var(--ease-out) both;
}

.subtitle {
  font-size: 1rem;
  color: var(--slate-500);
  margin-bottom: 1.75rem;
  animation: slideInDown 0.6s var(--ease-out) 0.1s both;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Form Controls ────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.3s var(--ease-out);
}

.form-group:hover .form-label {
  color: var(--brand-700);
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--slate-800);
  background: var(--slate-50);
  transition:
    border-color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out),
    background 0.3s var(--ease-out),
    transform 0.2s var(--ease-spring);
}

.form-input::placeholder {
  color: var(--slate-400);
  transition: color 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-700);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.1);
  transform: translateY(-2px);
}

.form-input:focus::placeholder {
  color: transparent;
}

.form-input:not(:placeholder-shown) {
  border-color: var(--brand-100);
  background: #fff;
}

/* ── Emoticon Grid ────────────────────────────── */
.emo-grid {
  display: flex;
  gap: 0.5rem;
}

.emo-grid__item {
  flex: 1;
  min-width: 0;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  padding: 0.85rem 0.4rem;
  text-align: center;
  transition:
    border-color 0.3s var(--ease-out),
    background 0.3s var(--ease-out),
    transform 0.3s var(--ease-spring),
    box-shadow 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

/* Background shine effect */
.emo-grid__item::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  transform: translateX(-100%) rotate(45deg);
  transition: transform 0.6s;
}

.emo-grid__item:hover::before {
  transform: translateX(100%) rotate(45deg);
}

.emo-grid__item:hover {
  border-color: var(--brand-100);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.15);
}

.emo-grid__item--selected {
  border-color: var(--brand-900);
  background: linear-gradient(135deg, var(--brand-50) 0%, #dbeafe 100%);
  transform: translateY(-5px) scale(1.08);
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.25);
  animation: emoSelect 0.5s var(--ease-spring);
}

.emo-grid__item input[type="radio"] {
  display: none;
}

.emo-grid__face {
  font-size: 2.25rem;
  display: block;
  margin-bottom: 0.4rem;
  line-height: 1;
  transition: transform 0.3s var(--ease-spring);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.emo-grid__item:hover .emo-grid__face {
  transform: scale(1.2) rotate(5deg);
  animation: emoBounce 0.6s var(--ease-spring);
}

.emo-grid__item--selected .emo-grid__face {
  transform: scale(1.3);
  animation: emoPop 0.5s var(--ease-spring);
  filter: drop-shadow(0 4px 8px rgba(30, 58, 138, 0.2));
}

.emo-grid__label {
  font-size: 0.7rem;
  color: var(--slate-500);
  font-weight: 600;
  line-height: 1.2;
  transition:
    color 0.3s,
    transform 0.3s var(--ease-out);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.emo-grid__item:hover .emo-grid__label {
  color: var(--brand-700);
}

.emo-grid__item--selected .emo-grid__label {
  color: var(--brand-900);
  font-weight: 700;
}

/* Staggered animation for emoticons */
.emo-grid__item:nth-child(1) {
  animation: slideInLeft 0.5s var(--ease-out) 0.1s both;
}

.emo-grid__item:nth-child(2) {
  animation: slideInLeft 0.5s var(--ease-out) 0.2s both;
}

.emo-grid__item:nth-child(3) {
  animation: slideInLeft 0.5s var(--ease-out) 0.3s both;
}

.emo-grid__item:nth-child(4) {
  animation: slideInLeft 0.5s var(--ease-out) 0.4s both;
}

.emo-grid__item:nth-child(5) {
  animation: slideInLeft 0.5s var(--ease-out) 0.5s both;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* ── Number Grid (skala 1-10) ─────────────────── */
.num-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.375rem;
}

.num-grid__item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--slate-600);
  transition:
    border-color 0.2s,
    background 0.2s,
    color 0.2s,
    transform 0.2s var(--ease-spring),
    box-shadow 0.2s;
  user-select: none;
}

.num-grid__item:hover {
  border-color: var(--brand-100);
  background: var(--brand-50);
  transform: scale(1.08);
}

.num-grid__item--selected {
  border-color: var(--brand-900);
  background: var(--brand-900);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(30, 58, 138, 0.3);
}

.num-grid__item input[type="radio"] {
  display: none;
}

/* ── Produk Checkbox Items ─────────────────────── */
.produk-item {
  transition:
    border-color 0.3s var(--ease-out),
    background 0.3s var(--ease-out),
    transform 0.3s var(--ease-spring),
    box-shadow 0.3s var(--ease-out);
  animation: slideInUp 0.5s var(--ease-out) both;
}

.produk-item:nth-child(1) {
  animation-delay: 0.1s;
}
.produk-item:nth-child(2) {
  animation-delay: 0.15s;
}
.produk-item:nth-child(3) {
  animation-delay: 0.2s;
}
.produk-item:nth-child(4) {
  animation-delay: 0.25s;
}
.produk-item:nth-child(5) {
  animation-delay: 0.3s;
}
.produk-item:nth-child(6) {
  animation-delay: 0.35s;
}

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

.produk-item:hover {
  border-color: var(--brand-100);
  transform: translateX(8px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.produk-item:has(input:checked) {
  border-color: var(--brand-900) !important;
  background: linear-gradient(
    135deg,
    var(--brand-50) 0%,
    #dbeafe 100%
  ) !important;
  box-shadow: 0 4px 16px rgba(30, 58, 138, 0.2);
  transform: translateX(8px) scale(1.02);
  animation: produkSelect 0.4s var(--ease-spring);
}

@keyframes produkSelect {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
  100% {
    transform: translateX(8px) scale(1.02);
  }
}

/* ── Buttons ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-out),
    box-shadow 0.2s,
    background 0.2s,
    opacity 0.2s;
}

.btn--primary {
  width: 100%;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
  color: #fff;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-brand);
  margin-top: 1.75rem;
  position: relative;
  overflow: hidden;
}

.btn--primary::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.btn--primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.4);
}

.btn--primary:active:not(:disabled) {
  transform: translateY(-1px) scale(0.98);
}

.btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn--secondary {
  padding: 0.6rem 1.5rem;
  background: var(--slate-100);
  color: var(--slate-700);
  font-size: 0.9rem;
  border-radius: var(--radius-md);
}

.btn--secondary:hover {
  background: var(--slate-200);
}

/* ── Success Screen ──────────────────────────── */
.success {
  text-align: center;
  padding: 2.5rem 0 1rem;
}

.success__icon {
  width: 5.5rem;
  height: 5.5rem;
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.35);
  animation:
    pop 0.65s var(--ease-spring) both,
    pulse 2s ease-in-out infinite 0.65s;
}

.success__icon svg {
  width: 2.6rem;
  height: 2.6rem;
  stroke: #fff;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: draw 0.5s 0.3s ease both;
}

.success__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 0.5rem;
  animation: slideInDown 0.6s var(--ease-out) 0.4s both;
}

.success__msg {
  color: var(--slate-500);
  font-size: 1rem;
  max-width: 26rem;
  margin: 0 auto 1.75rem;
  line-height: 1.7;
  animation: slideInDown 0.6s var(--ease-out) 0.5s both;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.35);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.5);
    transform: scale(1.05);
  }
}

/* ── Confetti Animation ───────────────────────── */
.confetti {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti__piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  background: var(--color);
  opacity: 0;
  animation: confettiFall 3s ease-out forwards;
  animation-delay: var(--delay);
}

.confetti__piece:nth-child(odd) {
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

.confetti__piece:nth-child(3n) {
  width: 6px;
  height: 12px;
  border-radius: 2px;
}

.confetti__piece:nth-child(4n) {
  width: 12px;
  height: 6px;
  border-radius: 2px;
}

@keyframes confettiFall {
  0% {
    top: -10px;
    opacity: 1;
    transform: translateX(0) rotate(0deg) scale(1);
  }
  100% {
    top: 100%;
    opacity: 0;
    transform: translateX(100px) rotate(720deg) scale(0.5);
  }
}

/* ── Error Banners ────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.alert--error {
  background: var(--red-100);
  color: var(--red-800);
}

/* ── Footer ───────────────────────────────────── */
.sitefooter {
  width: 100%;
  text-align: center;
  padding: 1.25rem 1rem 0;
}

.sitefooter__copy {
  font-size: 0.78rem;
  color: var(--slate-400);
}

/* ── Keyframes ────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-20deg);
  }
  60% {
    transform: scale(1.12) rotate(4deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 40;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* Animasi emoticon */
@keyframes emoBounce {
  0%,
  100% {
    transform: scale(1.2) rotate(5deg);
  }
  50% {
    transform: scale(1.3) rotate(-5deg);
  }
}

@keyframes emoPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.5) rotate(10deg);
  }
  100% {
    transform: scale(1.3);
  }
}

@keyframes emoSelect {
  0% {
    transform: translateY(-3px) scale(1.05);
  }
  50% {
    transform: translateY(-8px) scale(1.12);
  }
  100% {
    transform: translateY(-5px) scale(1.08);
  }
}

.anim-fadeup {
  animation: fadeUp 0.5s var(--ease-out) both;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 600px) {
  .card {
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-lg);
  }

  .title {
    font-size: 1.35rem;
  }

  .num-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.3rem;
  }

  /* Label emoticon tetap muncul di mobile */
  .emo-grid__label {
    display: block;
    font-size: 0.65rem;
  }

  .emo-grid__face {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
  }

  /* Logo lebih kecil di mobile */
  .page__logo img {
    width: 90px;
  }

  .topbar__label {
    display: none;
  }
}

@media (max-width: 380px) {
  .emo-grid {
    gap: 0.3rem;
  }
  .emo-grid__face {
    font-size: 1.6rem;
  }

  /* Logo lebih kecil lagi untuk layar sangat kecil */
  .page__logo img {
    width: 80px;
  }

  /* Disable heavy animations on small mobile for performance */
  .card::before,
  .card::after {
    animation: none;
  }

  .page__logo img {
    animation: none;
  }
}

@media (max-width: 380px) {
  .emo-grid {
    gap: 0.3rem;
  }
  .emo-grid__face {
    font-size: 1.6rem;
  }
}
