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

:root{
  --bg:#F8F1E7;
  --card:#FFFDF9;
  --brown:#49352D;
  --muted:#806E64;
  --line:#E6D9CC;
  --soft:#F3E9DE;
}

/* =========================
   BASE
========================= */

*,
*::before,
*::after{
  box-sizing:border-box;
}

html{
  width:100%;
  max-width:100%;
}

body{
  width:100%;
  max-width:100%;
  min-width:0;
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--brown);
  font-family:Lora,Georgia,serif;
}

button,
input,
select,
textarea{
  font:inherit;
  box-sizing:border-box;
  max-width:100%;
}

/* =========================
   PAGE
========================= */

.page{
  width:100%;
  max-width:720px;
  min-width:0;
  min-height:100vh;
  margin:0 auto;
  padding:28px 18px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

/* =========================
   BRAND
========================= */

.brand{
  text-align:center;
  margin:0 0 34px;
}

.brand h1{
  margin:0;
  font-size:clamp(30px,5vw,48px);
  line-height:1.15;
  font-weight:500;
  letter-spacing:-0.8px;
}

.brand p{
  margin:10px 0 0;
  font-size:clamp(12px,1.5vw,14px);
  line-height:1.5;
  font-weight:400;
  color:var(--muted);
}

.brand-icon{
  width:64px;
  height:64px;
  margin:0 auto 14px;
}

.brand-icon svg{
  width:100%;
  height:100%;
  display:block;
  max-width:100%;
}

/* =========================
   SCREEN
========================= */

.screen{
  display:none;
  width:100%;
  max-width:100%;
  min-width:0;
}

.screen.active{
  display:block;
  animation:fade .22s ease;
}

@keyframes fade{
  from{
    opacity:0;
    transform:translateY(5px);
  }
  to{
    opacity:1;
    transform:none;
  }
}

/* =========================
   HOME
========================= */

.home-actions{
  display:grid;
  gap:14px;
  width:100%;
  max-width:440px;
  margin:auto;
}

.main-btn,
.secondary-btn{
  width:100%;
  max-width:100%;
  border-radius:14px;
  padding:16px 18px;
  cursor:pointer;
  transition:.18s;
}

.main-btn{
  border:1px solid var(--brown);
  background:var(--brown);
  color:#fffaf5;
}

.secondary-btn{
  border:1px solid var(--brown);
  background:transparent;
  color:var(--brown);
}

.main-btn:hover{
  opacity:.94;
}

.secondary-btn:hover{
  background:#ffffff55;
}

/* =========================
   NAVIGATION
========================= */

.back{
  border:0;
  background:none;
  color:var(--muted);
  padding:0;
  margin-bottom:20px;
  cursor:pointer;
  font-size:14px;
}

.section-title{
  margin:0 0 7px;
  font-size:25px;
  font-weight:600;
}

.section-desc{
  margin:0 0 24px;
  color:var(--muted);
  font-size:14px;
  line-height:1.65;
}

/* =========================
   CARD
========================= */

.card{
  width:100%;
  max-width:100%;
  min-width:0;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  padding:20px;
  margin-bottom:15px;
}

.card-title{
  margin:0 0 16px;
  font-size:17px;
  font-weight:600;
}

/* =========================
   FORM
========================= */

.field{
  width:100%;
  max-width:100%;
  min-width:0;
  margin-bottom:17px;
}

.field:last-child{
  margin-bottom:0;
}

.field-note{
  margin:7px 2px 0;
  color:var(--muted);
  font-size:11px;
  line-height:1.5;
}

.field-note strong{
  font-weight:600;
  color:var(--brown);
}

label{
  display:block;
  margin-bottom:7px;
  font-size:13px;
  font-weight:600;
}

.label-with-example{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:8px;
}

.label-with-example label{
  margin:0;
}

.label-with-example a{
  font-size:12px;
  color:#806E64;
  text-decoration:underline;
  text-underline-offset:2px;
}

.label-with-example a:hover{
  color:#49352D;
}

.required:after{
  content:" *";
  color:#A86D59;
}

input,
select,
textarea{
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  color:var(--brown);
  padding:12px 13px;
  outline:none;
}

textarea{
  min-height:90px;
  resize:vertical;
}

input:focus,
select:focus,
textarea:focus{
  border-color:#B9967C;
  box-shadow:0 0 0 3px #B9967C20;
}

/* =========================
   DATE & TIME
   iPhone / Safari safe
========================= */

input[type="date"],
input[type="time"]{
  width:100%;
  max-width:100%;
  min-width:0;
  display:block;
  box-sizing:border-box;

  /* Prevent Safari from forcing a wider native control */
  -webkit-appearance:auto;
  appearance:auto;
}

input[type="date"]::-webkit-date-and-time-value{
  text-align:left;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator{
  filter:invert(22%) sepia(12%) saturate(600%)
         hue-rotate(340deg) brightness(88%) contrast(88%);
  opacity:1;
  cursor:pointer;
}

/* =========================
   TIME INPUT
========================= */

.time-row{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:10px;
}

.time-row input{
  width:100%;
  min-width:0;
}

.time-separator{
  font-size:16px;
  color:#806E64;
}

/* =========================
   SPLIT TIME
========================= */

.split-time-option{
  margin-top:12px;
}

.split-time-toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  font-size:14px;
  color:#49352D;
}

.split-time-toggle input[type="checkbox"]{
  width:auto;
  height:auto;
  margin:0;
  padding:0;
}

.split-session{
  margin-top:16px;
}

.split-session-title{
  font-size:13px;
  font-weight:600;
  margin-bottom:8px;
  color:#49352D;
}

#session1Label{
  margin-top:2px;
}

#splitTimeFields{
  margin-top:16px;
}

#splitTimeOption{
  margin-top:12px;
}

/* =========================
   RADIO
========================= */

.radio-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  width:100%;
  max-width:100%;
}

.radio-card{
  min-width:0;
}

.radio-card input{
  position:absolute;
  width:1px;
  height:1px;
  margin:0;
  padding:0;
  opacity:0;
  pointer-events:none;
}

.radio-card label{
  width:100%;
  min-width:0;
  margin:0;
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  cursor:pointer;
  text-align:center;
  background:#fff;
  font-weight:500;
}

.radio-card input:checked+label{
  border-color:var(--brown);
  background:var(--soft);
}

/* =========================
   HIDDEN
========================= */

.hidden{
  display:none!important;
}

/* =========================
   PAYMENT
========================= */

.payment-option{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  width:100%;
  max-width:100%;
  margin-bottom:15px;
}

.payment-option button{
  width:100%;
  min-width:0;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:var(--brown);
  padding:13px 10px;
  cursor:pointer;
}

.payment-option button.active{
  border-color:var(--brown);
  background:var(--soft);
}

.payment-detail{
  width:100%;
  max-width:100%;
  min-width:0;
  border:1px dashed #B9967C;
  border-radius:13px;
  padding:15px;
  background:#FBF5EE;
}

.bank-logo{
  width:110px;
  max-width:100%;
  margin:0 auto 8px;
}

.bank-logo svg{
  width:100%;
  height:auto;
  display:block;
  max-width:100%;
}

.qris{
  width:min(280px,100%);
  max-width:100%;
  display:block;
  margin:4px auto 12px;
  border-radius:10px;
}

.qris svg{
  width:100%;
  height:auto;
  display:block;
  max-width:100%;
}

.qris-wrap{
  position:relative;
  width:min(280px,100%);
  margin:4px auto 12px;
}

.qris-wrap .qris{
  width:100%;
  margin:0;
}

.qris-download{
  position:absolute;
  top:8px;
  right:8px;

  width:32px;
  height:32px;
  padding:0;

  border:0;
  border-radius:8px;

  background:#ffffffdd;
  color:var(--brown);

  display:flex;
  align-items:center;
  justify-content:center;

  cursor:pointer;
  transition:.18s ease;
}

.qris-download svg{
  width:17px;
  height:17px;
}

.qris-download:hover{
  background:#fff;
}

.qris-tooltip{
  position:absolute;
  right:0;
  bottom:calc(100% + 7px);

  background:var(--brown);
  color:#fffaf5;

  font-family:Lora,Georgia,serif;
  font-size:10px;
  font-weight:500;
  line-height:1;

  padding:6px 8px;
  border-radius:6px;

  white-space:nowrap;

  opacity:0;
  visibility:hidden;
  pointer-events:none;

  transition:.18s ease;
}

.qris-tooltip::after{
  content:"";
  position:absolute;
  right:10px;
  top:100%;

  border:4px solid transparent;
  border-top-color:var(--brown);
}

.qris-download:hover .qris-tooltip{
  opacity:1;
  visibility:visible;
}

/* =========================
   ACCOUNT / COPY
========================= */

.account{
  width:100%;
  max-width:100%;
  text-align:center;
  padding:5px 0;
}

.account-copy{
  max-width:100%;
  border:0;
  background:none;
  color:var(--brown);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin:5px 0;
  padding:4px 8px;
  cursor:pointer;
}

.account-number{
  max-width:100%;
  font-size:23px;
  font-weight:700;
  letter-spacing:1px;
  overflow-wrap:anywhere;
}

.copy-wrap{
  position:relative;
  display:flex;
  align-items:center;
  min-width:0;
}

.copy-icon{
  width:18px;
  height:18px;
  max-width:18px;
  flex:none;
  transition:.18s ease;
}

.account-copy:hover .copy-icon{
  opacity:.65;
}

.copy-tooltip{
  position:absolute;
  left:50%;
  bottom:calc(100% + 7px);
  transform:translateX(-50%);
  background:var(--brown);
  color:#fffaf5;
  font-family:Lora,Georgia,serif;
  font-size:10px;
  font-weight:500;
  line-height:1;
  padding:6px 8px;
  border-radius:6px;
  white-space:nowrap;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:.18s ease;
}

.copy-tooltip:after{
  content:"";
  position:absolute;
  left:50%;
  top:100%;
  transform:translateX(-50%);
  border:4px solid transparent;
  border-top-color:var(--brown);
}

.copy-wrap:hover .copy-tooltip{
  opacity:1;
  visibility:visible;
}

/* =========================
   TEXT / NOTICE
========================= */

.small{
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
}

.notice{
  margin-top:14px;
  padding:12px 14px;
  border-radius:11px;
  background:var(--soft);
  font-size:12px;
  line-height:1.6;
}

.submit{
  margin-top:18px;
}

.error{
  color:#9A5747;
  font-size:12px;
  margin-top:7px;
  display:none;
}

/* =========================
   MEDIA
========================= */

@media (max-width:600px){

  .page{
    padding:24px 18px;
  }

  .brand{
    margin-bottom:26px;
  }

  .brand h1{
    font-size:clamp(29px,8vw,36px);
    letter-spacing:-0.5px;
  }

  .brand p{
    font-size:12px;
  }

  .brand-icon{
    width:52px;
    height:52px;
    margin-bottom:12px;
  }

  .home-actions{
    gap:12px;
  }

  .main-btn,
  .secondary-btn{
    padding:14px 16px;
    font-size:14px;
  }

  /*
    iPhone / mobile:
    force form controls to stay inside card
  */
  .card,
  .field,
  .radio-grid,
  .payment-option,
  .payment-detail{
    min-width:0;
    max-width:100%;
  }

  input,
  select,
  textarea{
    width:100%;
    min-width:0;
    max-width:100%;
  }

  input[type="date"],
  input[type="time"]{
    width:100%;
    min-width:0;
    max-width:100%;
  }
}

@media (max-width:380px){

  .page{
    padding:20px 15px;
  }

  .brand h1{
    font-size:28px;
  }

  .brand p{
    font-size:11px;
  }

  .main-btn,
  .secondary-btn{
    padding:13px 15px;
  }

  .card{
    padding:17px;
  }
}