/* =========================================================
   LOGIN GLOW (Ocean Theme) - match bg laut & langit terang
   - Default: desktop collapsed (cuma tombol Login)
   - Hover / focus-within: expand full box
   - Desktop: hero kiri, login kanan
   - Mobile: hero atas, login bawah (form always expanded)
   ========================================================= */

:root{
  /* Warm Night Toll Palette */

  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.70);
  --stroke: rgba(255,180,120,0.25);

  /* background image */
  --login-bg-url: url("../../brand/tol.jpg");

  /* === GANTI OCEAN KE WARM AMBER === */
  --ocean-1: 255, 140, 0;     /* amber */
  --ocean-2: 255, 170, 60;    /* warm orange */
  --ocean-3: 255, 110, 0;     /* deep orange */
  --ocean-4: 255, 200, 120;   /* soft glow */

  /* glass lebih gelap biar cocok night */
  --glass-1: rgba(10, 8, 6, 0.55);
  --glass-2: rgba(5, 4, 3, 0.78);

  --card-w: 360px;

  --mx: 0px;
  --my: 0px;
  --mx2: 0px;
  --my2: 0px;

  --shine-x: 40%;
  --shine-y: 30%;
}


/* =========================================================
   Background + Parallax
   ========================================================= */
.login-body{
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;

  position: relative;
  overflow-x: hidden;
  overflow-y: auto;

  background:
    radial-gradient(900px 700px at 20% 15%, rgba(var(--ocean-1), 0.12), transparent 60%),
    radial-gradient(900px 700px at 70% 75%, rgba(var(--ocean-2), 0.08), transparent 65%),
    linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.55)),
    var(--login-bg-url);

  background-size:
    cover,
    cover,
    cover,
    108% 108%;

  background-repeat: no-repeat;
  background-position: center;
}


/* Override per-layer ikut gerak */
.login-body{
  background-position:
    /* radial 1 */
    calc(20% + (clamp(-8px, var(--mx2), 8px) * 0.15))
    calc(15% + (clamp(-8px, var(--my2), 8px) * 0.15)),

    /* radial 2 */
    calc(70% + (clamp(-8px, var(--mx2), 8px) * 0.10))
    calc(75% + (clamp(-8px, var(--my2), 8px) * 0.10)),

    /* dark gradient (static) */
    center,

    /* IMAGE (ini yang penting!) */
    calc(50% + clamp(-14px, var(--mx), 14px))
    calc(50% + clamp(-14px, var(--my), 14px));
}


/* overlay depth */
.login-body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;

  background:
    radial-gradient(1200px 900px at 50% 110%,
      rgba(0,0,0,0.45), transparent 60%);

  mix-blend-mode: normal;
}


/* grain */
.login-body::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.07;

  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.03) 0px,
      rgba(255,255,255,0.03) 1px,
      transparent 2px,
      transparent 4px
    );

  transform: translate3d(calc(var(--mx2) * 0.05), calc(var(--my2) * 0.05), 0);
  mix-blend-mode: overlay;
}

/* pastikan konten di atas overlay */
.page-brand,
.login-wrap,
.hero-text{
  position: relative;
  z-index: 2;
}

/* =========================================================
   TOP-LEFT BRAND
   ========================================================= */
.page-brand{
  position: fixed;
  top: 16px;
  left: 18px;
  right: 18px;              /* bikin container melebar sampai kanan */
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: space-between; /* kiri & kanan */
  gap: 12px;

  pointer-events: none;
}

.page-brand__badge{
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 12px;

  background:
    linear-gradient(135deg,
      rgba(var(--ocean-2), 0.20),
      rgba(0,0,0,0.35) 55%,
      rgba(var(--ocean-1), 0.14)
    ),
    rgba(20, 12, 6, 0.55);
  
  border: 1px solid rgba(var(--ocean-2), 0.30);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow:
    0 18px 50px rgba(0,0,0,0.55),
    0 0 35px rgba(var(--ocean-2), 0.25),
    0 0 18px rgba(var(--ocean-1), 0.18);

  opacity: 0.98;

  position: relative;
  transform-style: preserve-3d;
  transition: transform 220ms ease, filter 220ms ease;
  will-change: transform;
}

.page-brand__badge::after{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius: 14px;
  background: radial-gradient(220px 140px at var(--shine-x) var(--shine-y),
    rgba(255,255,255,0.35), transparent 60%);
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}

.page-brand__logo{
  height: 36px;
  width: auto;
  display: block;
  filter:
    drop-shadow(0 10px 18px rgba(0,0,0,0.28))
    saturate(1.05)
    contrast(1.02);
}

.page-brand__badge:hover{
  filter: saturate(1.08);
  transform: translateY(-1px) scale(1.02);
}
.page-brand__badge:hover::after{ opacity: 1; }
.page-brand__badge:hover .page-brand__logo{
  animation: logoWiggle 900ms ease-in-out infinite;
}

@keyframes logoWiggle{
  0%   { transform: translate3d(0,0,0) rotate(-0.8deg) scale(1.01); }
  50%  { transform: translate3d(0,-1px,0) rotate(0.8deg)  scale(1.02); }
  100% { transform: translate3d(0,0,0) rotate(-0.8deg) scale(1.01); }
}

/* =========================================================
   LAYOUT DESKTOP: HERO kiri + LOGIN kanan
   ========================================================= */
.login-wrap{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(18px, 4vw, 56px);

  padding-left: clamp(16px, 6vw, 84px);
  padding-right: clamp(16px, 6vw, 84px);

  /* ruang aman buat logo fixed */
  padding-top: 85px;
  padding-bottom: 28px;
}

/* HERO */
.hero-text{
  flex: 1 1 auto;
  max-width: 620px;
  min-width: 0;
  pointer-events: none;
}

.hero-title{
  margin: 0 0 12px 0;
  font-size: clamp(22px, 3.0vw, 44px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: .2px;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 10px 28px rgba(0,0,0,0.45);
  overflow-wrap: anywhere;
}

/* rotator (h3 nanti di markup) */
.hero-rotator{
  position: relative;
  min-height: 3.8em; /* pakai min-height biar gak kepotong */
  overflow: hidden;
}

.rotate-text{
  margin: 0;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;

  opacity: 0;
  transform: translateY(10px);
  transition: opacity 420ms ease, transform 420ms ease;

  font-size: clamp(14px, 1.15vw, 17px);
  font-weight: 700;
  line-height: 1.45;
  color: rgba(255,255,255,0.78);
  text-shadow: 0 8px 22px rgba(0,0,0,0.40);
  overflow-wrap: anywhere;
}

.rotate-text.active{
  opacity: 1;
  transform: translateY(0);
}

/* ===== HERO FONT (DESKTOP) ===== */
.hero-wrap .hero-title{
  font-size: 52px;     /* H1 */
  line-height: 1.1;
}

.hero-wrap .hero-rotator .rotate-text{
  font-size: 20px;     /* H3 */
  line-height: 1.5;
}

@media (max-width: 1024px){
  .hero-wrap .hero-title{
    font-size: 44px;
  }

  .hero-wrap .hero-rotator .rotate-text{
    font-size: 18px;
  }
}

@media (max-width: 576px){
  .hero-wrap .hero-title{
    font-size: 30px;
  }

  .hero-wrap .hero-rotator .rotate-text{
    font-size: 15px;
  }
}


@media (min-width: 769px){
  .hero-text{
    transform: translateX(-34px);
  }
}


/* =========================================================
   LOGIN GLOW
   ========================================================= */
.login-glow{
  width: min(var(--card-w), 92vw);
  border-radius: 22px;
  padding: 2px;
  position: relative;
  overflow: hidden;
  isolation: isolate;

  flex: 0 0 auto;

  box-shadow:
    0 26px 90px rgba(0,0,0,0.40),
    0 0 80px rgba(255,140,0,0.18),
    0 0 34px rgba(255,200,120,0.12);
}

.login-glow::before{
  content:"";
  position:absolute;
  inset:-130%;
  border-radius: 999px;

  background:
    conic-gradient(
      from 180deg,
      rgba(255,190,110,0.55),
      rgba(255,150,60,0.75),
      rgba(255,120,20,0.55),
      rgba(255,110,0,0.30),
      rgba(255,190,110,0.55)
    );

  animation: loginSpin 6s linear infinite;

  filter: blur(12px) saturate(1.2);
  opacity: 0.85;
}

.login-glow::after{
  content:"";
  position:absolute;
  inset:2px;
  background: rgba(0,0,0,0.22);
  border-radius: 20px;
  z-index: -1;
}

@keyframes loginSpin { to { transform: rotate(360deg); } }

/* Glass Card */
.login-card{
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.14);

  background:
    linear-gradient(135deg,
      rgba(var(--ocean-2), 0.12),
      rgba(0,0,0,0.18) 35%,
      rgba(var(--ocean-1), 0.09)
    ),
    linear-gradient(180deg, var(--glass-1), var(--glass-2));

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 18px;
}

/* =========================================================
   Collapse/Expand Behavior (DESKTOP)
   ========================================================= */
.login-collapsible{
  transform-origin: right bottom;
  transition: transform 240ms ease, filter 240ms ease, opacity 240ms ease;
  transform: scale(0.90);
  opacity: 0.96;
  filter: saturate(1.0);
  outline: none;
}

.login-content{
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(10px);
  pointer-events: none;
  transition: max-height 300ms ease, opacity 240ms ease, transform 240ms ease;
}

.login-cta{
  padding-top: 6px;
  display: block;
}

.login-collapsible:hover,
.login-collapsible:focus-within{
  transform: scale(1);
  opacity: 1;
  filter: saturate(1.06);
}

.login-collapsible:hover .login-content,
.login-collapsible:focus-within .login-content{
  max-height: 560px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.login-collapsible:not(:hover):not(:focus-within) .login-card{
  padding: 12px;
}

/* =========================================================
   Typography
   ========================================================= */
.login-title{
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .2px;
  color: rgba(255,200,120,0.95);
}

.login-subtitle{
  font-size: 13px;
  color: rgba(255,200,120,0.65);
}

.login-badge{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.16);
}

/* =========================================================
   Inputs
   ========================================================= */
.login-ig-left{
  border: 0 !important;
  border-radius: 14px 0 0 14px !important;
  background: rgba(0,0,0,0.20) !important;
  color: rgba(255,255,255,0.86) !important;
}

.login-ig-right{
  border: 0 !important;
  border-radius: 0 14px 14px 0 !important;
  background: rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.92) !important;
}

.login-input{
  border: 0 !important;
  background: rgba(0,0,0,0.20) !important;
  color: var(--text) !important;
  padding: 12px 14px !important;
}

.login-input::placeholder{
  color: rgba(255,255,255,0.45) !important;
}

.login-input:focus{
  box-shadow: 0 0 0 4px rgba(var(--ocean-2), 0.14) !important;
}

/* Links */
.login-link{
  color: rgba(var(--ocean-1), 0.95);
  text-decoration: none;
}
.login-link:hover{ text-decoration: underline; }

/* Main Button */
.login-btn{
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 900;
  color: #1a1208;

  background: linear-gradient(90deg,
    rgba(255,170,60,1),
    rgba(255,140,0,1),
    rgba(255,110,0,1)
  );

  box-shadow:
    0 18px 55px rgba(0,0,0,0.55),
    0 0 30px rgba(255,140,0,0.35);
}

.login-btn:hover{
  filter: brightness(1.08);
}


/* Captcha Placeholder */
.captcha-box{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
}

.captcha-left{
  display:flex;
  align-items:center;
  gap:10px;
}

.captcha-left i{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.12);
}

.captcha-title{
  font-weight: 900;
  font-size: 13px;
  line-height: 1.1;
}

.captcha-sub{
  font-size: 11px;
  color: var(--muted);
}

.captcha-btn{
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  color: rgba(0,0,0,0.92);
  background: rgba(255,255,255,0.88);
}

/* =========================================================
   RESPONSIVE: MOBILE (FORM ALWAYS EXPANDED)
   ========================================================= */
@media (max-width: 768px){

  .login-wrap{
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;

    padding-left: 16px;
    padding-right: 16px;

    /* ruang aman buat logo fixed */
    padding-top: 86px;
    padding-bottom: 18px;
  }

  .hero-text{
    width: min(560px, 92vw);
    max-width: none;
    text-align: center;
  }

  .hero-rotator{
    min-height: 6.2em; /* aman utk 2-4 baris */
  }

  .rotate-text{
    left: 50%;
    transform: translate(-50%, 10px);
    text-align: center;
  }
  .rotate-text.active{
    transform: translate(-50%, 0);
  }

  /* DI MOBILE: jangan collapsible, form selalu kebuka */
  .login-collapsible{
    transform: none;
    opacity: 1;
    filter: none;
  }

  .login-content{
    max-height: none;     /* ini yang bikin CTA gak “ilang” */
    opacity: 1;
    overflow: visible;
    transform: none;
    pointer-events: auto;
  }

  .login-card{
    padding: 16px;
  }

  .login-cta{
    padding-top: 10px;
    display: block;
  }

  /* logo kecil */
  .page-brand{ top: 12px; left: 12px; }
  .page-brand__badge{ padding: 6px 8px; border-radius: 10px; }
  .page-brand__logo{ height: 22px; }

  .login-body::after{ opacity: 0.10; }
  .page-brand__badge:hover .page-brand__logo{ animation: none; }
}

/* extra small phones */
@media (max-width: 420px){
  .hero-title{ font-size: 22px; }
  .hero-rotator{ min-height: 7.2em; }
}
