/* ───────────────────────────────────────────────
   Den Login · style.css
   ─────────────────────────────────────────────── */

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

:root {
  --bg: #090d16;
  --card: #121623;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(255, 255, 255, 0.14);
  --input-bg: #181c2a;
  --input-border: #2e3347;
  --input-focus: #6366f1;
  --text: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #10b981;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 8px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.25s var(--ease-out);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

/* -- Window Chrome -- */
.window-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #0e1019;
  border-bottom: 1px solid var(--card-border);
  user-select: none;
  flex-shrink: 0;
}

.chrome-left {
  display: flex;
  gap: 7px;
  align-items: center;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }

.chrome-center {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.chrome-right { display: flex; }

.badge {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  padding: 3px 10px;
  border-radius: 20px;
}

/* -- Scene -- */
.scene {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 32px;
  gap: 24px;
}

/* -- Card Wrapper (mascot + card) -- */
.card-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
}

/* -- Mascot -- */
.mascot-wrapper {
  position: relative;
  z-index: 10;
  width: 150px;
  height: 128px;
  margin-bottom: -30px;
  pointer-events: none;
}

.mascot-svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
  transition: transform 0.4s var(--spring);
  will-change: transform;
}

.mascot-wrapper:hover .mascot-svg {
  transform: scale(1.05);
}

/* Cat ear twitch on hover */
.mascot-ears {
  transition: transform 0.4s var(--spring);
  transform-origin: center 70px;
}

.mascot-wrapper:hover .mascot-ears {
  animation: ear-twitch 0.6s var(--spring);
}

@keyframes ear-twitch {
  0%   { transform: rotate(0deg) scaleY(1); }
  15%  { transform: rotate(3deg) scaleY(1.04); }
  35%  { transform: rotate(-3deg) scaleY(1.02); }
  55%  { transform: rotate(2deg) scaleY(1.03); }
  75%  { transform: rotate(-1deg) scaleY(1.01); }
  100% { transform: rotate(0deg) scaleY(1); }
}

/* Whisker micro-bounce on hover */
.mascot-whiskers {
  transition: transform 0.3s var(--spring);
}

.mascot-wrapper:hover .mascot-whiskers {
  animation: whisker-bounce 0.5s var(--spring);
}

@keyframes whisker-bounce {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(1px); }
  40%  { transform: translateX(-1px); }
  60%  { transform: translateX(0.5px); }
  80%  { transform: translateX(-0.3px); }
  100% { transform: translateX(0); }
}

/* Idle whisker subtle sway */
.whisker {
  transform-origin: center;
}

.whisker-l1, .whisker-r1 {
  animation: whisker-sway-up 3s ease-in-out infinite alternate;
}
.whisker-l2, .whisker-r2 {
  animation: whisker-sway-mid 3.5s ease-in-out infinite alternate;
  animation-delay: 0.3s;
}
.whisker-l3, .whisker-r3 {
  animation: whisker-sway-down 3.2s ease-in-out infinite alternate;
  animation-delay: 0.6s;
}

@keyframes whisker-sway-up {
  from { transform: rotate(0deg); }
  to   { transform: rotate(1.5deg); }
}
@keyframes whisker-sway-mid {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-1deg); }
}
@keyframes whisker-sway-down {
  from { transform: rotate(0deg); }
  to   { transform: rotate(1deg); }
}

/* Iris + pupil group smooth transitions (moves together) */
.iris-group {
  transition: transform 0.12s ease-out;
  will-change: transform;
}

/* Cat tail idle gentle swish */
.mascot-tail {
  transform-origin: 168px 98px;
  transition: transform 0.3s var(--spring);
  animation: tail-swish-idle 2.8s ease-in-out infinite alternate;
}

@keyframes tail-swish-idle {
  0%   { transform: rotate(-3deg); }
  50%  { transform: rotate(3deg); }
  100% { transform: rotate(-3deg); }
}

/* Happy state */
.mascot-wrapper.is-happy .eye-white,
.mascot-wrapper.is-happy .eye-white-shade,
.mascot-wrapper.is-happy .iris-group {
  display: none;
}

.mascot-wrapper.is-happy .happy-eye {
  display: block !important;
}

.mascot-wrapper.is-happy .mouth-normal,
.mascot-wrapper.is-happy .mouth-cleft {
  display: none;
}

.mascot-wrapper.is-happy .mouth-happy {
  display: block !important;
}

.mascot-wrapper.is-happy .blush {
  opacity: 0.65 !important;
  transition: opacity 0.5s var(--spring);
}

/* Blush glow pulse in happy state */
.mascot-wrapper.is-happy .blush {
  animation: blush-glow 1.2s ease-in-out infinite alternate;
}

@keyframes blush-glow {
  from { opacity: 0.5; }
  to   { opacity: 0.75; }
}

/* Excited tail wag in happy state (overrides idle swish) */
.mascot-wrapper.is-happy .mascot-tail {
  animation: wag-tail-happy 0.25s ease-in-out infinite alternate;
}

@keyframes wag-tail-happy {
  from { transform: rotate(-12deg); }
  to   { transform: rotate(12deg); }
}

/* Tongue blep bounce in happy state */
.mascot-wrapper.is-happy .tongue {
  animation: tongue-bounce 0.6s ease-in-out infinite alternate;
}

@keyframes tongue-bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(1.5px); }
}

/* Whisker perk in happy state */
.mascot-wrapper.is-happy .mascot-whiskers {
  animation: whisker-happy 0.4s ease-in-out infinite alternate;
}

@keyframes whisker-happy {
  from { transform: scaleX(1); }
  to   { transform: scaleX(1.06); }
}

/* Covering eyes (password peek reaction) - paws slide up */
.mascot-wrapper.is-peeking .paw-left {
  animation: peek-left 0.35s var(--spring) forwards;
}
.mascot-wrapper.is-peeking .paw-right {
  animation: peek-right 0.35s var(--spring) forwards;
}

@keyframes peek-left {
  to { transform: translate(10px, -58px); }
}
@keyframes peek-right {
  to { transform: translate(-10px, -58px); }
}

/* Not peeking (paws return) */
.paw-left, .paw-right {
  transition: transform 0.4s var(--spring);
  will-change: transform;
}

/* -- Login Card -- */
.login-card {
  position: relative;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 42px 32px 32px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.02),
    0 8px 40px rgba(0,0,0,0.45),
    0 2px 8px rgba(0,0,0,0.2);
  transition: border-color var(--transition);
}

.login-card:hover {
  border-color: var(--card-border-hover);
}

.card-title {
  font-size: 1.45rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.card-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 26px;
}

/* -- Form -- */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  pointer-events: none;
  transition: color var(--transition);
}

.input-wrap input {
  width: 100%;
  padding: 11px 12px 11px 38px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-wrap input::placeholder {
  color: #64748b;
}

.input-wrap input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}

.input-wrap:focus-within .input-icon {
  color: var(--input-focus);
}

/* Password input needs right padding for eye toggle */
#password {
  padding-right: 44px;
}

/* -- Eye Toggle -- */
.eye-toggle {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition), transform 0.15s var(--spring);
}

.eye-toggle:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.eye-toggle:active {
  transform: scale(0.9);
}

.eye-icon {
  width: 20px;
  height: 20px;
}

/* -- Checkbox / Form Row -- */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -4px;
}

.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-wrap input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--input-border);
  border-radius: 4px;
  background: var(--input-bg);
  position: relative;
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}

.checkbox-wrap input:checked + .checkmark {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-wrap input:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.forgot-link {
  font-size: 0.8rem;
  font-weight: 500;
}

/* -- Sign In Button -- */
.btn-signin {
  position: relative;
  width: 100%;
  padding: 13px 0;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: background var(--transition), transform 0.2s var(--spring), box-shadow var(--transition);
  margin-top: 4px;
  will-change: transform;
}

.btn-signin:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px rgba(99,102,241,0.35);
}

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

.btn-label {
  position: relative;
  z-index: 2;
  transition: opacity 0.4s var(--ease-out);
}

/* -- 3D Door Scene -- */
.door-scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 600px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.btn-signin.is-open .btn-label {
  opacity: 0;
}

.btn-signin.is-open .door-scene {
  opacity: 1;
}

.door-frame {
  position: relative;
  width: 32px;
  height: 38px;
  border: 2px solid rgba(255,255,255,0.6);
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  transform-style: preserve-3d;
}

.door-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #fffbe6, #fbbf24 60%, transparent 100%);
  opacity: 0;
  transition: opacity 0.6s var(--ease-out) 0.15s;
}

.btn-signin.is-open .door-glow {
  opacity: 1;
}

.door-panel {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.25);
  transform-origin: left center;
  transition: transform 0.8s var(--spring);
  backface-visibility: hidden;
  will-change: transform;
}

.door-knob {
  position: absolute;
  right: 4px;
  top: 50%;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  transform: translateY(-50%);
}

.btn-signin.is-open .door-panel {
  transform: rotateY(-72deg);
}

/* -- Stickman -- */
.stickman {
  position: absolute;
  width: 26px;
  height: 38px;
  left: calc(50% - 34px);
  bottom: 3px;
  transition: transform 1.2s var(--spring), opacity 0.6s var(--ease-out) 0.7s;
  will-change: transform, opacity;
}

.btn-signin.is-open .stickman {
  transform: translateX(36px);
  opacity: 0;
}

/* Walking animation */
.stickman.is-walking .stick-leg-l {
  animation: walk-leg-l 0.25s ease-in-out infinite alternate;
  transform-origin: 20px 35px;
}
.stickman.is-walking .stick-leg-r {
  animation: walk-leg-r 0.25s ease-in-out infinite alternate;
  transform-origin: 20px 35px;
}
.stickman.is-walking .stick-arm-l {
  animation: walk-arm-l 0.25s ease-in-out infinite alternate;
  transform-origin: 20px 20px;
}
.stickman.is-walking .stick-arm-r {
  animation: walk-arm-r 0.25s ease-in-out infinite alternate;
  transform-origin: 20px 20px;
}

@keyframes walk-leg-l {
  from { transform: rotate(-18deg); }
  to   { transform: rotate(18deg);  }
}
@keyframes walk-leg-r {
  from { transform: rotate(18deg);  }
  to   { transform: rotate(-18deg); }
}
@keyframes walk-arm-l {
  from { transform: rotate(12deg);  }
  to   { transform: rotate(-12deg); }
}
@keyframes walk-arm-r {
  from { transform: rotate(-12deg); }
  to   { transform: rotate(12deg);  }
}

/* -- Divider -- */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 18px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

.divider span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* -- Social Buttons -- */
.social-row {
  display: flex;
  gap: 12px;
}

.btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 0;
  border-radius: 50px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform 0.2s var(--spring), box-shadow var(--transition);
  will-change: transform;
}

.btn-social:hover {
  background: #1e2233;
  border-color: var(--card-border-hover);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

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

.btn-social:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.social-icon {
  width: 18px;
  height: 18px;
}

.btn-apple {
  color: #fff;
}

/* -- Success Banner -- */
.success-banner {
  position: absolute;
  inset: 0;
  background: var(--card);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--spring);
  z-index: 20;
}

.success-banner.show {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.success-banner .dismiss-btn {
  margin-top: 8px;
  padding: 6px 20px;
  border: 1px solid var(--card-border);
  border-radius: 50px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 0.15s var(--spring);
}

.success-banner .dismiss-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.success-banner .dismiss-btn:active {
  transform: scale(0.96);
}

.success-check {
  width: 56px;
  height: 56px;
}

.check-path {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  transition: stroke-dashoffset 0.6s var(--ease-out) 0.3s;
}

.success-banner.show .check-path {
  stroke-dashoffset: 0;
}

.success-banner span {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--success);
}

/* -- Code Drawer -- */
.code-drawer {
  width: 100%;
  max-width: 960px;
}

.drawer-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform 0.15s var(--spring);
}

.drawer-toggle:hover {
  background: #181c28;
  color: var(--text);
  border-color: var(--card-border-hover);
}

.drawer-toggle:active {
  transform: scale(0.99) translateY(1px);
}

.code-icon {
  width: 18px;
  height: 18px;
}

.chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.35s var(--spring);
}

.code-drawer.is-open .chevron {
  transform: rotate(180deg);
}

.drawer-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--spring);
}

.code-drawer.is-open .drawer-content {
  max-height: 600px;
}

.code-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 14px;
}

.code-col {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.code-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #0e1019;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--card-border);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.code-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.html-dot { background: #f06529; }
.css-dot  { background: #2965f1; }
.js-dot   { background: #f0db4f; }

.code-block {
  padding: 14px;
  margin: 0;
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  line-height: 1.65;
  color: #a5b4c8;
  tab-size: 2;
}

.code-block code {
  font-family: inherit;
}

/* -- Responsive -- */
@media (max-width: 720px) {
  .code-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .login-card {
    padding: 38px 20px 24px;
  }
  .scene {
    padding: 16px 12px 24px;
  }
}

/* -- Focus visible -- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
  outline: none;
}

/* -- Reduced Motion -- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .mascot-svg {
    transition: none;
  }

  .iris-group {
    transition: none;
  }

  .mascot-ears {
    transition: none;
  }

  .mascot-wrapper:hover .mascot-ears {
    animation: none;
  }

  .mascot-whiskers {
    transition: none;
  }

  .mascot-wrapper:hover .mascot-whiskers {
    animation: none;
  }

  .whisker {
    animation: none;
  }

  .whisker-l1, .whisker-l2, .whisker-l3,
  .whisker-r1, .whisker-r2, .whisker-r3 {
    animation: none;
  }

  .paw-left, .paw-right {
    transition: none;
  }

  .mascot-wrapper.is-peeking .paw-left,
  .mascot-wrapper.is-peeking .paw-right {
    animation: none;
    transform: translate(0, -58px);
  }

  .mascot-wrapper.is-happy .mascot-tail {
    animation: none;
  }

  .mascot-wrapper.is-happy .blush {
    animation: none;
    transition: none;
    opacity: 0.6;
  }

  .mascot-wrapper.is-happy .tongue {
    animation: none;
  }

  .mascot-wrapper.is-happy .mascot-whiskers {
    animation: none;
  }

  .mascot-tail {
    transition: none;
    animation: none;
  }

  .door-panel {
    transition: none;
  }

  .btn-signin.is-open .door-panel {
    transform: rotateY(-72deg);
  }

  .stickman {
    transition: none;
  }

  .btn-signin.is-open .stickman {
    transform: translateX(36px);
    opacity: 0;
  }

  .stickman.is-walking .stick-leg-l,
  .stickman.is-walking .stick-leg-r,
  .stickman.is-walking .stick-arm-l,
  .stickman.is-walking .stick-arm-r {
    animation: none;
  }

  .success-banner {
    transition: none;
  }

  .success-banner.show {
    transform: scale(1);
    opacity: 1;
  }

  .check-path {
    transition: none;
    stroke-dashoffset: 0;
  }

  .door-scene,
  .btn-label,
  .door-glow {
    transition: none;
  }

  .chevron {
    transition: none;
  }

  .drawer-content {
    transition: none;
  }
}

/* -- Scrollbar -- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2d3250; border-radius: 3px; }
