:root {
  --jk-font: "Nunito", system-ui, sans-serif;
  --jk-display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --jk-ink: #5a3a1a;
  --jk-muted: #9a7a55;
  --jk-wood: #8b5318;
  --jk-wood-deep: #5c3210;
  --jk-cream: #f8ead0;
  --jk-paper: #f6e6c4;
  --jk-orange: #ff9a1f;
  --jk-orange-hi: #ffc14a;
  --jk-orange-lo: #ef6d12;
  --jk-safe-t: env(safe-area-inset-top, 0px);
  --jk-safe-b: env(safe-area-inset-bottom, 0px);
  --jk-shell-top: #3a7f9c;
  --jk-shell-mid: #2a6580;
  --jk-shell-deep: #234e66;
  --jk-shell-base: #0f2c41;
  --jk-shell-gradient: linear-gradient(
    180deg,
    var(--jk-shell-top) 0%,
    var(--jk-shell-mid) 38%,
    var(--jk-shell-deep) 62%,
    var(--jk-shell-base) 100%
  );
}

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

html, body {
  margin: 0;
  min-height: 100%;
}

body.jk-auth {
  min-height: 100dvh;
  font-family: var(--jk-font);
  color: var(--jk-ink);
  background-color: var(--jk-shell-base);
  background-image: var(--jk-shell-gradient);
  background-size: 100% 100%;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.jk-wrap {
  width: 100%;
  max-width: 420px;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    calc(10px + var(--jk-safe-t))
    max(16px, env(safe-area-inset-right))
    calc(24px + var(--jk-safe-b))
    max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.jk-hero {
  width: min(320px, 88vw);
  margin: 4px auto 2px;
  filter: drop-shadow(0 10px 16px rgba(70, 40, 10, 0.28));
}

.jk-hero {
  background: transparent;
}

.jk-hero img {
  display: block;
  width: 100%;
  height: auto;
}

.jk-card {
  position: relative;
  width: 100%;
  margin-top: -6px;
  padding: 18px 16px 20px;
  border-radius: 28px;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 255, 255, 0.55), transparent 60%),
    linear-gradient(180deg, #fff6e4 0%, #f4dfb6 46%, #edd09a 100%);
  border: 7px solid #b06a28;
  box-shadow:
    0 10px 0 #6e3c12,
    0 18px 28px rgba(80, 40, 8, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -8px 16px rgba(150, 90, 20, 0.12);
  overflow: hidden;
}

.jk-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 20px;
  border: 2px solid rgba(255, 236, 196, 0.7);
  pointer-events: none;
}

.jk-leaf {
  position: absolute;
  width: 42px;
  height: 42px;
  z-index: 2;
  pointer-events: none;
}

.jk-leaf--tl { top: -8px; left: -6px; transform: rotate(-18deg); }
.jk-leaf--tr { top: -6px; right: -8px; transform: rotate(22deg) scaleX(-1); }
.jk-leaf--bl { bottom: -8px; left: -8px; transform: rotate(-128deg); }
.jk-leaf--br { bottom: -10px; right: -6px; transform: rotate(118deg) scaleX(-1); }

.jk-tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f3d7a4, #e8c78a);
  box-shadow:
    inset 0 2px 4px rgba(90, 50, 10, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.55);
}

.jk-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--jk-display);
  font-size: 16px;
  font-weight: 800;
  color: #8d6a3e;
  background: transparent;
}

.jk-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.jk-tab.is-active {
  color: #fff;
  background: linear-gradient(180deg, #ffd056 0%, #ff9e22 48%, #f07810 100%);
  box-shadow:
    0 4px 0 #c45a0c,
    0 8px 12px rgba(200, 90, 10, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 0 rgba(120, 50, 0, 0.35);
}

.jk-form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jk-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 6px 12px 6px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffdf8, #fff7ea);
  border: 2px solid #e8d2a8;
  box-shadow: inset 0 2px 4px rgba(160, 120, 60, 0.08);
}

.jk-field:focus-within {
  border-color: #f0a030;
  box-shadow:
    inset 0 2px 4px rgba(160, 120, 60, 0.08),
    0 0 0 3px rgba(255, 154, 31, 0.18);
}

.jk-ico {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #3aa0e8;
}

.jk-ico--lock { color: #4a90e2; }
.jk-ico--ticket { color: #3b82f6; }
.jk-ico--user { color: #3aa0e8; }

.jk-dial {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 14px;
  color: #2f8fd6;
}

.jk-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--jk-font);
  font-size: 14px;
  font-weight: 700;
  color: var(--jk-ink);
}

.jk-field input::placeholder {
  color: #b59a74;
  font-weight: 700;
}

.jk-field input[readonly] {
  color: #7a5a32;
}

/* Custom toggle only — hide browser password reveal (duplicate eye on Edge/Chrome) */
.jk-field input[type="password"]::-ms-reveal,
.jk-field input[type="password"]::-ms-clear {
  display: none;
}

.jk-field input[type="password"]::-webkit-textfield-decoration-container {
  display: none !important;
}

.jk-field input[type="password"]::-webkit-credentials-auto-fill-button,
.jk-field input[type="password"]::-webkit-strong-password-auto-fill-button {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.jk-eye {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #c4a57a;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.jk-eye svg {
  width: 20px;
  height: 20px;
}

.jk-eye.is-on { color: #ef6d12; }

.jk-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  margin-top: 6px;
  border: 3px solid #8a4a12;
  border-radius: 16px;
  font-family: var(--jk-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  cursor: pointer;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.08) 0 10px,
      transparent 10px 20px
    ),
    linear-gradient(180deg, #ffd24d 0%, #ffb02a 28%, #ff8a16 68%, #e4680e 100%);
  box-shadow:
    0 6px 0 #6e3410,
    0 10px 16px rgba(90, 40, 8, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    inset 0 -3px 6px rgba(160, 60, 0, 0.25);
  text-shadow: 0 2px 0 rgba(120, 50, 0, 0.35);
}

.jk-submit:active {
  transform: translateY(3px);
  box-shadow:
    0 3px 0 #6e3410,
    0 6px 10px rgba(90, 40, 8, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.jk-submit svg {
  width: 18px;
  height: 18px;
}

.jk-hint {
  margin: 8px 2px 0;
  font-size: 11px;
  font-weight: 800;
  color: #8a6840;
  text-align: center;
}

@media (max-width: 360px) {
  .jk-hero { width: min(280px, 92vw); }
  .jk-tab { font-size: 14px; }
  .jk-submit { font-size: 18px; }
}
