/**
 * PETOKS — AUTHENTICATION EXPERIENCE SYSTEM
 * Shared UI/UX Stylesheet for Login, Register, Forgot Password, and OTP Verification
 * Visual Reference: template_login
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,800;0,900;1,800;1,900&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* DAY THEME (DEFAULT / AUTO LIGHT) */
  --bg: #f8fafc;
  --bg-body: #f8fafc;
  --deep-black: #ffffff;
  --card: #ffffff;
  --panel: #ffffff;
  --text: #0f172a;
  --text-soft: rgba(15, 23, 42, 0.72);
  --text-mute: rgba(15, 23, 42, 0.45);
  --line: rgba(0, 0, 0, 0.12);
  --line-strong: rgba(0, 0, 0, 0.22);
  --highlight: #f97316;
  --highlight-hover: #ea580c;
  --accent: #f97316;
  --accent-gold: #e5ad48;
  --field-bg: transparent;
  --post-card-bg: rgba(255, 255, 255, 0.88);
  --post-card-bdr: rgba(0, 0, 0, 0.12);
  --live-bg: rgba(255, 255, 255, 0.85);
  --btn-bg: #0f172a;
  --btn-fg: #ffffff;
  --input-border: rgba(0, 0, 0, 0.15);
  --input-focus: #0f172a;
  --err-bg: #fef2f2;
  --err-border: #fecaca;
  --err-text: #b91c1c;
  --succ-bg: #f0fdf4;
  --succ-border: #bbf7d0;
  --succ-text: #15803d;

  --ease-quiet: cubic-bezier(.22, 1, .36, 1);
  --ease-precise: cubic-bezier(.4, 0, .2, 1);
  --ease-emphasis: cubic-bezier(.16, 1, .3, 1);
}

/* NIGHT THEME */
html.theme-night,
html[data-theme="night"],
.theme-night {
  --bg: #000000;
  --bg-body: #000000;
  --deep-black: #0a0a0a;
  --card: #1a1a1a;
  --panel: #141210;
  --text: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.7);
  --text-mute: rgba(255, 255, 255, 0.35);
  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.3);
  --highlight: #f97316;
  --highlight-hover: #ea580c;
  --accent: #f97316;
  --accent-gold: #e5ad48;
  --field-bg: transparent;
  --post-card-bg: rgba(10, 10, 10, 0.74);
  --post-card-bdr: rgba(255, 255, 255, 0.18);
  --live-bg: rgba(26, 26, 26, 0.6);
  --btn-bg: #ffffff;
  --btn-fg: #000000;
  --input-border: rgba(255, 255, 255, 0.2);
  --input-focus: #ffffff;
  --err-bg: rgba(239, 68, 68, 0.12);
  --err-border: rgba(239, 68, 68, 0.35);
  --err-text: #fca5a5;
  --succ-bg: rgba(34, 197, 94, 0.12);
  --succ-border: rgba(34, 197, 94, 0.35);
  --succ-text: #86efac;
}

html.theme-night .auth-container,
html.theme-night .login-container,
html[data-theme="night"] .auth-container,
html[data-theme="night"] .login-container {
  background: #000000;
  background-color: #000000;
}

html.theme-night .visual-side,
html[data-theme="night"] .visual-side {
  background: #000000 !important;
  background-color: #000000 !important;
  border: none !important;
  border-right: none !important;
}

html.theme-night .form-side,
html[data-theme="night"] .form-side {
  background: #000000 !important;
  background-color: #000000 !important;
  border: none !important;
  border-left: none !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: var(--highlight); color: #ffffff; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background 0.3s var(--ease-quiet), color 0.3s var(--ease-quiet);
}

/* Custom cursor */
#custom-cursor {
  position: fixed; top: 0; left: 0; width: 12px; height: 12px;
  border-radius: 50%; background: var(--highlight); mix-blend-mode: difference;
  pointer-events: none; z-index: 9999; will-change: transform;
  transition: width .25s ease, height .25s ease, opacity .25s ease;
}
@media (hover: none), (pointer: coarse) {
  #custom-cursor { display: none !important; }
}

/* Particle canvas */
#particle-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

/* Auth Container Grid */
.auth-container,
.login-container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 100vh;
  background: #ffffff;
  background-color: #ffffff;
}

/* ==================== LEFT: HERO VISUAL SIDE ==================== */
.visual-side {
  position: relative;
  overflow: hidden;
  border: none !important;
  border-right: none !important;
  min-height: 100vh;
  background: #ffffff;
  background-color: #ffffff;
}
.visual-side.no-media {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: none !important;
  border-right: none !important;
}

.hero-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.4s var(--ease-quiet);
  will-change: opacity, transform;
}

.hero-slide.active {
  opacity: 1;
  animation: kenBurns 9s linear forwards;
}

@keyframes kenBurns {
  from { transform: scale(1.04); }
  to { transform: scale(1.15); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.3) 22%,
    rgba(0,0,0,0.2) 45%,
    rgba(0,0,0,0.75) 75%,
    rgba(0,0,0,0.95) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2.5rem;
  color: #ffffff;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #ffffff;
}

.brand-mark .divider-dot {
  width: 4px; height: 4px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
}

.slide-counter {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.slide-counter .current {
  color: #ffffff;
  font-weight: 600;
}

.slide-counter .separator {
  color: rgba(255, 255, 255, 0.35);
}

.hero-tagline {
  margin-top: 3.5rem;
}

.hero-tagline .label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.hero-tagline .label::before {
  content: '';
  width: 36px; height: 1px;
  background: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold);
}

.hero-tagline h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  max-width: 500px;
  margin-bottom: 1.25rem;
  color: #ffffff;
}

.hero-tagline h2 em {
  font-style: italic;
  font-weight: 800;
  color: var(--accent-gold);
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.hero-stats span strong {
  color: #ffffff;
  font-size: 0.85rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  margin-right: 0.35rem;
  letter-spacing: 0;
}

.hero-bottom {
  margin-top: auto;
}

.post-card-wrap {
  position: relative;
  min-height: 164px;
  max-width: 480px;
}

.post-card {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease-quiet);
  color: #ffffff;
}

.post-card.active {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.12s;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  background: #1e293b;
}

.post-info {
  flex: 1;
  min-width: 0;
}

.post-username {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-meta {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.post-follow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #ffffff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  transition: all 0.25s var(--ease-quiet);
  flex-shrink: 0;
}

.post-follow:hover {
  background: var(--highlight);
  border-color: var(--highlight);
}

.post-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 0 0.75rem;
}

.post-caption {
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.post-engagement {
  display: flex;
  gap: 1.25rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.eng-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.65);
}

.eng-item svg { width: 13px; height: 13px; }
.eng-item.is-liked { color: var(--highlight); }

/* Thumbnails */
.thumb-nav {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.thumb {
  width: 54px;
  height: 54px;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s var(--ease-quiet), box-shadow 0.3s var(--ease-quiet);
  flex-shrink: 0;
  cursor: pointer;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-quiet), filter 0.3s var(--ease-quiet);
  filter: brightness(0.5);
}

.thumb:hover img {
  transform: scale(1.08);
  filter: brightness(0.85);
}

.thumb.active {
  border-color: var(--highlight);
  box-shadow: 0 0 14px rgba(249, 115, 22, 0.5);
}

.thumb.active img {
  filter: brightness(1);
}

.hero-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--highlight);
  width: 0;
  z-index: 3;
  box-shadow: 0 0 8px var(--highlight);
}

.hero-progress.running {
  animation: progressFill 5s linear forwards;
}

@keyframes progressFill {
  from { width: 0%; }
  to { width: 100%; }
}

/* ==================== RIGHT: FORM SIDE ==================== */
.form-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.5rem 4rem;
  background: #ffffff;
  background-color: #ffffff;
  border: none !important;
  border-left: none !important;
  box-shadow: none !important;
  min-height: 100vh;
  transition: background 0.3s var(--ease-quiet);
}

.form-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 40%, rgba(249, 115, 22, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.form-side::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f97316'%3E%3Ccircle cx='5.5' cy='11' r='1.8'/%3E%3Ccircle cx='9.5' cy='7' r='1.8'/%3E%3Ccircle cx='14.5' cy='7' r='1.8'/%3E%3Ccircle cx='18.5' cy='11' r='1.8'/%3E%3Cellipse cx='12' cy='17' rx='4' ry='3.2'/%3E%3C/svg%3E");
  background-size: 160px;
  opacity: 0.02;
  pointer-events: none;
}

.form-top-bar {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  left: 2rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 10;
}

.theme-toggle-btn {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text-soft);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s var(--ease-quiet);
}

.theme-toggle-btn:hover {
  border-color: var(--highlight);
  color: var(--text);
}

.form-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.form-container.wide {
  max-width: 580px;
}

.brand-logo-wrap {
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-img {
  max-height: 48px;
  width: auto;
  object-fit: contain;
  display: block;
}

html.theme-night .brand-logo-img,
html[data-theme="night"] .brand-logo-img {
  content: url('../logo/Petok_Logo_White.png');
}

/* Vector Brand Logo */
.logo-petok {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-weight: 900;
  letter-spacing: -0.5px;
  user-select: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 26px;
  line-height: 1;
}
.logo-petok .l-br { color: var(--text); }
.logo-petok .l-acc { color: var(--highlight); }
.logo-petok .l-o {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--highlight);
  margin: 0 2px;
}
.logo-petok .l-o i { font-size: 11px; color: #ffffff; }

.form-header {
  margin-bottom: 2rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 1.25rem;
}

.eyebrow::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

.form-header h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 2.5vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 0.85rem;
  color: var(--text);
}

.form-header h1 .accent {
  color: var(--highlight);
  font-style: italic;
}

.form-header p {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.55;
}

/* Tab Switcher for Sign Up */
.auth-nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 2rem;
  background: var(--card);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.auth-nav-tab {
  flex: 1;
  padding: 10px 14px;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.25s var(--ease-quiet);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-nav-tab:hover {
  color: var(--text);
}

.auth-nav-tab.active {
  background: var(--highlight);
  color: #000000;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

/* Forms */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.fields-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1rem;
}

.field-group {
  position: relative;
}

.field-group.full {
  grid-column: 1 / -1;
}

.field-label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 0.55rem;
  transition: color 0.3s var(--ease-quiet);
}

.field-input,
.field-select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--input-border);
  padding: 0.65rem 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.3s var(--ease-quiet);
  caret-color: var(--highlight);
  border-radius: 0;
}

.field-select {
  cursor: pointer;
  padding-right: 20px;
}

.field-select option {
  background: var(--panel);
  color: var(--text);
}

.field-input::placeholder { color: var(--text-mute); }
.field-input:focus,
.field-select:focus { border-bottom-color: var(--input-focus); }
.field-group:focus-within .field-label { color: var(--text); }

/* Username Availability Feedback */
.username-availability-feedback {
  display: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  margin-top: 0.35rem;
  letter-spacing: 0.02em;
  line-height: 1.3;
  transition: opacity 0.2s var(--ease-quiet);
}

.username-availability-feedback.is-visible {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.username-availability-feedback.is-available {
  color: var(--succ-text);
}

.username-availability-feedback.is-unavailable {
  color: var(--err-text);
}

.username-availability-feedback.is-checking {
  color: var(--text-mute);
}

/* Password Input with Toggle Button */
.input-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-pass-wrap .field-input {
  padding-right: 48px;
}

.pass-toggle-btn {
  position: absolute;
  right: 0;
  bottom: 8px;
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.2s ease;
}

.pass-toggle-btn:hover {
  color: var(--highlight);
}

/* Options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -0.25rem;
}

.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-soft);
  position: relative;
  cursor: pointer;
  user-select: none;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-box {
  width: 16px; height: 16px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--ease-quiet);
  flex-shrink: 0;
  border-radius: 4px;
}

.checkbox-input:checked + .checkbox-box {
  background: var(--highlight);
  border-color: var(--highlight);
}

.checkbox-box svg {
  width: 10px; height: 10px;
  opacity: 0;
  transition: opacity 0.2s var(--ease-quiet);
}

.checkbox-input:checked + .checkbox-box svg { opacity: 1; }

.forgot-link,
.back-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.3s var(--ease-quiet);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.forgot-link::after,
.back-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--highlight);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-quiet);
}

.forgot-link:hover,
.back-link:hover { color: var(--text); }
.forgot-link:hover::after,
.back-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Submit Button */
.submit-btn {
  position: relative;
  width: 100%;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: none;
  padding: 1.05rem 2rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 600;
  overflow: hidden;
  transition: color 0.35s var(--ease-quiet);
  margin-top: 0.5rem;
  cursor: pointer;
  border-radius: 4px;
}

.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--highlight);
  transform: translateY(100%);
  transition: transform 0.45s var(--ease-quiet);
  z-index: 0;
}

.submit-btn:hover { color: #000000; }
.submit-btn:hover::before { transform: translateY(0); }

.submit-btn span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

.submit-btn .arrow {
  display: inline-block;
  transition: transform 0.35s var(--ease-quiet);
}

.submit-btn:hover .arrow { transform: translateX(6px); }

/* Alert Boxes */
.auth-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 1.25rem;
}

.auth-alert.error {
  background: var(--err-bg);
  border: 1px solid var(--err-border);
  color: var(--err-text);
}

.auth-alert.success {
  background: var(--succ-bg);
  border: 1px solid var(--succ-border);
  color: var(--succ-text);
}

.auth-alert.info {
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: var(--highlight);
}

.auth-alert i {
  margin-top: 2px;
  font-size: 14px;
}

/* OTP 6-Digit Field */
.otp-digit-wrap {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 1rem;
}

.otp-digit-input {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.35em;
  text-align: center;
  width: 100%;
  max-width: 320px;
  padding: 0.85rem 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--highlight);
  color: var(--text);
  outline: none;
}

.otp-timer-box {
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-bottom: 1.5rem;
}

.otp-timer-box strong {
  color: var(--highlight);
  font-size: 0.9rem;
}

/* Bottom Nav Link */
.signup-link,
.login-link {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.signup-link a,
.login-link a {
  color: var(--text);
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-left: 0.4rem;
  position: relative;
  display: inline-block;
  font-weight: 600;
}

.signup-link a::after,
.login-link a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--highlight);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-quiet);
}

.signup-link a:hover::after,
.login-link a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.side-footer {
  margin-top: 3rem;
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-mute);
}

.side-footer-links {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: none;
}

.side-footer-links a,
.side-footer-links a:link,
.side-footer-links a:visited,
.side-footer-links a:active,
.side-footer-links a:hover,
.side-footer-links a:focus {
  color: var(--text-soft) !important;
  text-decoration: none !important;
  transition: color 0.2s var(--ease-quiet);
}

.side-footer-links a:hover {
  color: var(--highlight);
}

.side-footer-links a:focus-visible {
  outline: 1px dashed var(--highlight);
  outline-offset: 2px;
}

/* Fade-in Animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease-quiet), transform 0.8s var(--ease-quiet);
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in[data-delay="1"] { transition-delay: 0.08s; }
.fade-in[data-delay="2"] { transition-delay: 0.18s; }
.fade-in[data-delay="3"] { transition-delay: 0.28s; }
.fade-in[data-delay="4"] { transition-delay: 0.38s; }
.fade-in[data-delay="5"] { transition-delay: 0.48s; }
.fade-in[data-delay="6"] { transition-delay: 0.58s; }
.fade-in[data-delay="7"] { transition-delay: 0.68s; }

/* Responsive Breakpoints */
@media (max-width: 1200px) {
  .form-side { padding: 3.5rem 3rem; }
  .hero-content { padding: 2rem; }
}

@media (max-width: 968px) {
  .auth-container,
  .login-container {
    grid-template-columns: 1fr;
  }
  .visual-side {
    min-height: 48vh;
    border: none !important;
    border-right: none !important;
    border-bottom: none !important;
  }
  .hero-content {
    min-height: 48vh;
    padding: 1.5rem;
  }
  .hero-tagline { margin-top: 1.5rem; }
  .hero-tagline h2 { font-size: 1.35rem; }
  .hero-stats { gap: 1rem; flex-wrap: wrap; }
  .post-card-wrap { max-width: 100%; min-height: 150px; }
  .form-side {
    padding: 2.5rem 1.5rem 3.5rem;
    justify-content: flex-start;
  }
  .form-top-bar {
    position: static;
    margin-bottom: 1.5rem;
    padding: 0;
  }
  .side-footer {
    margin-top: 2.2rem;
  }
  .side-footer-links {
    gap: 0.45rem;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
  }
}

@media (max-width: 640px) {
  .fields-grid-2 {
    grid-template-columns: 1fr;
  }
  .visual-side { min-height: 42vh; }
  .hero-content { padding: 1.25rem; }
  .hero-tagline { margin-top: 1.2rem; }
  .hero-tagline h2 { font-size: 1.15rem; }
  .hero-stats { display: none; }
  .post-card-wrap { min-height: 160px; }
  .post-card { padding: 0.9rem; }
  .thumb { width: 44px; height: 44px; }
  .form-side { padding: 2rem 1.25rem 3rem; }
  .form-header h1 { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in { opacity: 1; transform: none; }
  .hero-slide.active { animation: none; transform: scale(1.04); }
  .hero-progress.running { animation: none; width: 100%; }
}

/* ==========================================================================
   PETOKS SEARCHABLE SELECT (COMBOBOX)
   ========================================================================== */
.petok-searchable-select {
  position: relative;
  width: 100%;
}

.petok-ss-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.petok-ss-input {
  width: 100%;
  padding-right: 56px !important;
  cursor: text;
}

.petok-ss-controls {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
}

.petok-ss-btn {
  background: transparent;
  border: none;
  color: var(--text-mute);
  cursor: pointer;
  padding: 6px 7px;
  font-size: 0.82rem;
  border-radius: 4px;
  transition: color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.petok-ss-btn:hover {
  color: var(--text);
}

.petok-ss-toggle-btn.is-open {
  transform: rotate(180deg);
}

.petok-ss-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  max-height: 240px;
  overflow-y: auto;
  z-index: 1000;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

.petok-ss-dropdown::-webkit-scrollbar {
  width: 6px;
}
.petok-ss-dropdown::-webkit-scrollbar-track {
  background: transparent;
}
.petok-ss-dropdown::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}
.petok-ss-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--highlight);
}

.petok-ss-empty {
  padding: 14px 16px;
  color: var(--text-mute);
  font-size: 0.88rem;
  text-align: center;
  font-style: italic;
}

.petok-ss-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.petok-ss-item:hover,
.petok-ss-item.is-highlighted {
  background: rgba(249, 115, 22, 0.12);
  color: var(--highlight);
}

.petok-ss-item.is-selected {
  font-weight: 600;
  color: var(--highlight);
  background: rgba(249, 115, 22, 0.08);
}

.petok-ss-item.is-selected::after {
  content: '✓';
  font-size: 0.85rem;
  color: var(--highlight);
  margin-left: 8px;
}

.petok-ss-item-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.petok-ss-item-alt {
  font-size: 0.78rem;
  color: var(--text-mute);
  margin-left: 10px;
  flex-shrink: 0;
}

/* Fallback: when JS has not initialized, show native select and hide combobox elements */
.petok-searchable-select:not(.ss-initialized) .petok-ss-input-wrap,
.petok-searchable-select:not(.ss-initialized) .petok-ss-dropdown {
  display: none !important;
}

/* When initialized by JS, hide native select accessibly */
.petok-searchable-select.ss-initialized .petok-ss-native-select {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 640px) {
  .petok-ss-dropdown {
    max-height: 200px;
  }
  .petok-ss-item {
    padding: 11px 14px;
  }
}

