/* =========================================
   APPLE WWDC LEVEL – iOS SHEET EXPERIENCE
========================================= */

/* =========================
   ROOT THEME
========================= */

:root {
  --primary-green: #22C55E;
  --primary-green-pressed: #16A34A;
  --accent-orange: #F97316;

  --glass-bg: rgba(255,255,255,0.06);
  --glass-border: rgba(255,255,255,0.14);

  --text-primary: #F0FDF4;
  --text-secondary: rgba(255,255,255,0.65);
}

/* =========================
   BASE
========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "SF Pro Display", sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #0B0F19;
  min-height: 100vh;
  color: var(--text-primary);
}

/* Cinematic ambient lighting */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(34,197,94,0.18), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(249,115,22,0.15), transparent 45%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: url("https://pmb.mtsn7hst.id/assets/img/PMBM_280.png") center 40% no-repeat;
  background-size: 280px;
  opacity: 0.04;
  pointer-events: none;
}

/* =========================
   PRELOADER (Native Splash)
========================= */

.preloader {
  position: fixed;
  inset: 0;
  background: #ffffff; /* match GIF */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity .6s ease, visibility .6s ease;
}

.preloader .loading {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================
   WRAPPER
========================= */

.modal-wrap-body {
  padding: 24px 18px;
}

.modal-wrap {
  max-width: 520px;
  margin: 0 auto;
}

/* =========================
   HEADER – iOS Indicator
========================= */

.modal-header {
  height: 64px;
  backdrop-filter: blur(50px) saturate(200%);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 28px 28px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.modal-header span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: all .3s ease;
}

.modal-header span.is-active {
  width: 20px;
  border-radius: 8px;
  background: var(--primary-green);
}

/* =========================
   SHEET BODY
========================= */

.modal-bodies {
  position: relative;
  perspective: 1800px;
  min-height: 480px;
}

.modal-body {
  position: absolute;
  width: 100%;
  padding: 32px 24px;
  border-radius: 0 0 32px 32px;
  backdrop-filter: blur(60px) saturate(200%);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 50px 120px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,255,255,0.15);
  transform-origin: top left;
  display: none;
}

.modal-body.is-showing {
  display: block;
}

/* =========================
   PAPER ANIMATION – REFINED
========================= */

.animate-out {
  animation: paperOut 750ms cubic-bezier(.65,-0.2,.35,1.2) forwards;
}

.animate-in {
  display: block;
  animation: paperIn 650ms cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes paperOut {
  0% { transform: rotate(0deg) translateY(0); opacity: 1; }
  25% { transform: rotate(12deg); }
  60% { transform: rotate(24deg) translateY(180px); opacity: 0.85; }
  100% { transform: rotate(32deg) translateY(1100px); opacity: 0; }
}

@keyframes paperIn {
  0% {
    opacity: 0;
    transform: rotateX(-70deg) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: rotateX(0deg) scale(1);
  }
}

/* =========================
   TYPOGRAPHY
========================= */

.title {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 10px;
}

.description {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* =========================
   INPUT FIELDS – iOS GROUP STYLE
========================= */

input[type="text"],
input[type="email"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 18px 20px;
  margin-bottom: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  font-size: 17px;
  color: white;
  transition: all .25s ease;
}

textarea {
  min-height: 100px;
  resize: vertical;
  margin-bottom: 7px;
}

select {
  margin-bottom: 7px;
  cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 4px rgba(10,132,255,0.25);
  background: rgba(255,255,255,0.08);
}

input::placeholder,
textarea::placeholder {
  color: rgba(255,255,255,0.4);
}

/* =========================
   RADIO – iOS STYLE
========================= */

.radio-container {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-bottom: 20px;
}

input[type="radio"] {
  display: none;
}

input[type="radio"] + label {
  position: relative;
  padding-left: 34px;
  font-size: 16px;
  cursor: pointer;
}

input[type="radio"] + label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
}

input[type="radio"]:checked + label::before {
  border-color: var(--primary-green);
}

input[type="radio"]:checked + label::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 9px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-green);
}

/* =========================
   CHECKBOX – iOS STYLE
========================= */

.checkbox-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

input[type="checkbox"] {
  display: none;
}

input[type="checkbox"] + label {
  position: relative;
  padding-left: 36px;
  cursor: pointer;
  font-size: 16px;
}

input[type="checkbox"] + label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.4);
}

input[type="checkbox"]:checked + label::before {
  background: var(--primary-green);
  border-color: var(--primary-green);
}

input[type="checkbox"]:checked + label::after {
  content: "✓";
  position: absolute;
  left: 6px;
  top: 1px;
  font-size: 18px;
  color: white;
}

/* =========================
   STEP 4 – PREMIUM UPLOAD
========================= */

.upload-container {
  position: relative;
  width: 100%;
  /*padding: 48px 28px;*/
  padding: 24px;
  border-radius: 32px;
  border: 2px dashed rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(25px);
  text-align: center;
  cursor: pointer;
  transition: all .35s ease;
  overflow: hidden;
}

/* subtle ambient glow */
.upload-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left,
              rgba(34,197,94,0.25),
              transparent 60%);
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}

.upload-container:hover {
  border-color: var(--primary-green);
  box-shadow: 0 25px 70px rgba(34,197,94,0.35);
  transform: translateY(-4px);
}

.upload-container:hover::before {
  opacity: 1;
}

/* Hide real input properly */
.upload-container input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}

/* Upload Text Area */
.upload-text strong {
  font-size: 18px;
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.file-info {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin: 0;
}

/* =========================
   IMAGE PREVIEW
========================= */

.upload-container img {
  width: 100%;
  /*margin-top: 24px;*/
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  transition: all .4s ease;
  animation: fadePreview .5s ease;
}

@keyframes fadePreview {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================
   PROGRESS BAR – MODERN
========================= */

.progress {
  height: 8px;
  margin-top: 18px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  overflow: hidden;
  display: none;
}

.progress-bar {
  height: 100%;
  font-size: 0;
  background: linear-gradient(
    90deg,
    var(--primary-green),
    var(--accent-orange)
  );
  border-radius: 20px;
  transition: width .3s ease;
  box-shadow: 0 0 12px rgba(34,197,94,0.6);
}

/* =========================
   BUTTON – GLASS WWDC FIXED
========================= */

.button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 18px;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.18);

  font-size: 17px;
  font-weight: 600;
  letter-spacing: .3px;
  color: white;

  backdrop-filter: blur(30px) saturate(180%);
  background: linear-gradient(
    180deg,
    rgba(34,197,94,0.85),
    rgba(22,163,74,0.85)
  );

  box-shadow:
    0 10px 30px rgba(34,197,94,0.35),
    inset 0 1px 0 rgba(255,255,255,0.35);

  cursor: pointer;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

/* Glass highlight layer */
.button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left,
              rgba(255,255,255,0.4),
              transparent 60%);
  opacity: .4;
  pointer-events: none;
  z-index: 1;
}

/* Hover glow */
.button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 50px rgba(34,197,94,0.5),
    inset 0 1px 0 rgba(255,255,255,0.4);
}

.button:active {
  transform: scale(0.97);
  box-shadow:
    0 6px 18px rgba(34,197,94,0.4),
    inset 0 2px 6px rgba(0,0,0,0.25);
}

/* =========================
   DISABLED
========================= */

.button.disabled {
  pointer-events: none;
  cursor: not-allowed;
  transform: none;
  opacity: 0.65;

  background: linear-gradient(
    180deg,
    rgba(120,120,120,0.4),
    rgba(90,90,90,0.4)
  );

  border: 1px solid rgba(255,255,255,0.08);

  box-shadow:
    0 4px 15px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.15);
}

/* =========================
   LOADING SPINNER
========================= */

.button.is-loading {
  color: transparent;
  pointer-events: none;
}

.button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;                /* isi penuh tombol */
  margin: auto;            /* center otomatis */
  width: 22px;
  height: 22px;

  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.3);
  border-top: 3px solid #ffffff;

  animation: spin .7s linear infinite;
  z-index: 2;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================
   ERROR
========================= */

.error-input {
  border: 2px solid var(--ios-red) !important;
  background: rgba(255,69,58,0.12);
}

.error-message {
  color: var(--ios-red);
  font-size: 12px;
  margin-top: -10px;
  margin-bottom: 10px;
}

/* =========================
   SELECT FIX – DESKTOP SAFE
========================= */

select {
  width: 100%;
  padding: 18px 20px;
  margin-bottom: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  font-size: 17px;
  color: white;
  transition: all .25s ease;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7L10 12L15 7' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px;
}

/* Dropdown option fix */
select option {
  color: #000;
  background: #fff;
}

/* =========================
   FLOATING DOCK – PREMIUM
========================= */

.floating-dock {
  position: fixed;
  right: 18px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 2000;
}

.dock-btn {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(30px) saturate(180%);
  background: rgba(255,255,255,0.08);
  color: white;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s ease;
  box-shadow:
    0 10px 30px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

.dock-btn:hover {
  transform: translateY(-3px);
  background: rgba(34,197,94,0.25);
  border-color: var(--primary-green);
}

.dock-btn:active {
  transform: scale(0.95);
}

.brand {
  text-align: center;
  margin-bottom: 18px;
}

.brand img {
  width: 90px;
  opacity: 0.85;
  filter: drop-shadow(0 8px 20px rgba(34,197,94,0.5));
  transition: all .3s ease;
}

.brand img:hover {
  transform: scale(1.05);
  opacity: 1;
}

/* PREMIUM SCROLLBAR */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(34,197,94,0.5);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(34,197,94,0.8);
}

/* =========================
   DESKTOP ENHANCEMENT
========================= */

@media (min-width: 768px) {

  .modal-body {
    padding: 60px 70px;
  }

  .button {
    padding: 18px 46px;
  }
}