/* ==========================================================================
   HEX OFFICIAL - 4K ULTRA PREMIUM AUTHENTICATION UI
   Exact Reference Match: DANGER PANEL Layout & Visual Hierarchy
   Theme: Pure Black / Charcoal / Neon Red Accent (#080909 / #16171B / #FF0033)
   Namespace Scoped: #hex-auth-screen & .hex-auth*
   ========================================================================== */

:root {
  --hex-auth-bg: #080909;
  --hex-auth-card-bg: #16171b;
  --hex-auth-card-border: #282a32;
  --hex-auth-input-bg: #111215;
  --hex-auth-input-border: #282a33;
  --hex-auth-tab-bg: #101114;
  --hex-auth-tab-border: #24262f;
  --hex-auth-red: #FF0033;
  --hex-auth-red-dark: #D4002B;
  --hex-auth-red-glow: rgba(255, 0, 51, 0.35);
  --hex-auth-discord: #5865F2;
  --hex-auth-discord-hover: #4752c4;
}

/* --------------------------------------------------------------------------
   1. BRANDED SPLASH LOADER (PREVENTS AUTH FLASH)
   -------------------------------------------------------------------------- */
.hex-auth-loader-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 9999999;
  background-color: var(--hex-auth-bg);
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(255, 0, 51, 0.14) 0%, transparent 60%),
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 36px 36px, 36px 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.hex-auth-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hex-auth-loader-logo-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.hex-auth-loader-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 20px rgba(255, 0, 51, 0.45));
}

.hex-auth-loader-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--hex-auth-red);
  border-right-color: rgba(255, 0, 51, 0.35);
  animation: hexAuthRingSpin 0.9s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
  z-index: 1;
}

@keyframes hexAuthRingSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hex-auth-loader-brand {
  font-family: 'Rajdhani', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #FFFFFF;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.hex-auth-loader-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: #7E91A6;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hex-auth-loader-sub::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--hex-auth-red);
  box-shadow: 0 0 8px var(--hex-auth-red);
  animation: hexAuthDotPulse 1.4s ease-in-out infinite;
}

@keyframes hexAuthDotPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* --------------------------------------------------------------------------
   2. MAIN AUTHENTICATION SCREEN WRAPPER
   -------------------------------------------------------------------------- */
#hex-auth-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 999999;
  background-color: var(--hex-auth-bg);
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 38px 38px, 38px 38px;
  background-position: center center;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Three.js Background Canvas */
#hex-auth-three-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Auth Viewport Content Container */
.hex-auth__viewport {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1240px;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  box-sizing: border-box;
}

/* Two-Column Grid */
.hex-auth__layout {
  width: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
}

/* --------------------------------------------------------------------------
   3. LEFT COLUMN: BRAND PRESENTATION
   -------------------------------------------------------------------------- */
.hex-auth__brand-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 20px;
}

/* Ambient Red Glow behind Logo */
.hex-auth__brand-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 0, 51, 0.22) 0%, rgba(255, 0, 51, 0.06) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(24px);
}

/* Logo Rounded Square Badge */
.hex-auth__logo-box {
  position: relative;
  z-index: 1;
  width: 104px;
  height: 104px;
  background: #121316;
  border: 1px solid rgba(255, 0, 51, 0.6);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 35px rgba(255, 0, 51, 0.28), 0 8px 24px rgba(0, 0, 0, 0.7);
  margin-bottom: 24px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.hex-auth__logo-box:hover {
  transform: scale(1.04);
  box-shadow: 0 0 45px rgba(255, 0, 51, 0.4), 0 10px 30px rgba(0, 0, 0, 0.8);
}

.hex-auth__logo-img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6));
}

/* Brand Name Heading */
.hex-auth__brand-heading {
  position: relative;
  z-index: 1;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #FFFFFF;
  margin: 0 0 12px 0;
  line-height: 1.1;
}

.hex-auth__brand-heading span {
  color: var(--hex-auth-red);
  text-shadow: 0 0 25px rgba(255, 0, 51, 0.5);
}

/* Description */
.hex-auth__brand-desc {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.65;
  color: #94a3b8;
  max-width: 410px;
  margin: 0 0 28px 0;
}

/* Trust Badges Row */
.hex-auth__badges {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hex-auth__badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #131418;
  border: 1px solid #252833;
  border-radius: 9999px;
  padding: 8px 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.hex-auth__badge-pill:hover {
  border-color: rgba(255, 0, 51, 0.4);
  transform: translateY(-1px);
}

.hex-auth__badge-icon {
  color: var(--hex-auth-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   4. RIGHT COLUMN: AUTHENTICATION CARD
   -------------------------------------------------------------------------- */
.hex-auth__card-section {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.hex-auth__card {
  width: 100%;
  max-width: 415px;
  background: var(--hex-auth-card-bg);
  border: 1px solid var(--hex-auth-card-border);
  border-radius: 22px;
  padding: 30px 28px;
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.75),
    0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
  backdrop-filter: blur(16px);
  position: relative;
}

/* Card Header */
.hex-auth__card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.hex-auth__card-icon-wrap {
  width: 42px;
  height: 42px;
  background: rgba(255, 0, 51, 0.12);
  border: 1px solid rgba(255, 0, 51, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hex-auth-red);
  shrink-0: 0;
  flex-shrink: 0;
}

.hex-auth__card-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hex-auth__card-title {
  font-size: 21px;
  font-weight: 900;
  color: #FFFFFF;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hex-auth__card-title span {
  color: var(--hex-auth-red);
}

.hex-auth__card-subtitle {
  font-size: 11.5px;
  font-weight: 500;
  color: #94a3b8;
  margin: 4px 0 0 0;
  line-height: 1.5;
}

/* Segmented Control Tabs */
.hex-auth__tabs {
  background: var(--hex-auth-tab-bg);
  border: 1px solid var(--hex-auth-tab-border);
  border-radius: 13px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.hex-auth__tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  border-radius: 9px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.hex-auth__tab-btn:hover {
  color: #FFFFFF;
}

.hex-auth__tab-btn--active {
  background: rgba(255, 0, 51, 0.12);
  border-color: rgba(255, 0, 51, 0.8);
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(255, 0, 51, 0.2);
}

/* Alert Notification Boxes */
.hex-auth__alert {
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: hexAuthFadeIn 0.25s ease-out;
}

@keyframes hexAuthFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.hex-auth__alert--error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.hex-auth__alert--success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* Form Styles */
.hex-auth__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hex-auth__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hex-auth__field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hex-auth__label {
  font-size: 11.5px;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.01em;
}

.hex-auth__link {
  font-size: 11px;
  font-weight: 600;
  color: var(--hex-auth-red);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
  font-family: inherit;
}

.hex-auth__link:hover {
  text-decoration: underline;
  opacity: 0.9;
}

/* Input Box */
.hex-auth__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  background: var(--hex-auth-input-bg);
  border: 1px solid var(--hex-auth-input-border);
  border-radius: 11px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hex-auth__input-wrap:focus-within {
  border-color: var(--hex-auth-red);
  box-shadow: 0 0 0 2px rgba(255, 0, 51, 0.25);
}

.hex-auth__input-icon {
  position: absolute;
  left: 14px;
  color: #64748b;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hex-auth__input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 0 14px 0 42px;
  font-size: 12.5px;
  font-weight: 500;
  color: #FFFFFF;
  font-family: inherit;
  box-sizing: border-box;
}

.hex-auth__input::placeholder {
  color: #475569;
}

.hex-auth__input--has-toggle {
  padding-right: 42px;
}

.hex-auth__pw-toggle {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.hex-auth__pw-toggle:hover {
  color: #cbd5e1;
}

/* Cloudflare Turnstile */
.hex-auth__turnstile {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 65px;
  width: 100%;
  margin: 2px 0;
  overflow: hidden;
}

.hex-auth__turnstile-inner {
  display: flex;
  justify-content: center;
}

/* Main Action Button (Red Gradient) */
.hex-auth__submit-btn {
  height: 44px;
  width: 100%;
  background: linear-gradient(135deg, var(--hex-auth-red) 0%, var(--hex-auth-red-dark) 100%);
  border: none;
  border-radius: 11px;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(255, 0, 51, 0.35);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.hex-auth__submit-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(255, 0, 51, 0.45);
}

.hex-auth__submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.hex-auth__submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

/* Divider: OR CONTINUE WITH */
.hex-auth__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
}

.hex-auth__divider-line {
  flex: 1;
  height: 1px;
  background: #252833;
}

.hex-auth__divider-text {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  white-space: nowrap;
}

/* Social Buttons */
.hex-auth__socials {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hex-auth__social-btn {
  height: 42px;
  width: 100%;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

/* Google Button */
.hex-auth__google-btn {
  background: #131417;
  border: 1px solid #282a32;
  color: #e2e8f0;
}

.hex-auth__google-btn:hover:not(:disabled) {
  background: #191b20;
  border-color: #3b3f4d;
  color: #FFFFFF;
}

/* Discord Button */
.hex-auth__discord-btn {
  background: var(--hex-auth-discord);
  border: 1px solid transparent;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.25);
}

.hex-auth__discord-btn:hover:not(:disabled) {
  background: var(--hex-auth-discord-hover);
  box-shadow: 0 6px 18px rgba(88, 101, 242, 0.35);
}

.hex-auth__social-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Back to Login Button */
.hex-auth__back-btn {
  background: transparent;
  border: 1px solid #252833;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 700;
  padding: 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 4px;
}

.hex-auth__back-btn:hover {
  background: #181a20;
  color: #FFFFFF;
  border-color: #383c4a;
}

/* --------------------------------------------------------------------------
   5. RESPONSIVE ADJUSTMENTS & 4K SUPPORT
   -------------------------------------------------------------------------- */

/* 4K Displays (2560px and 3840px) */
@media (min-width: 2000px) {
  .hex-auth__viewport {
    max-width: 1400px;
  }
  .hex-auth__brand-heading {
    font-size: 46px;
  }
  .hex-auth__brand-desc {
    font-size: 15px;
    max-width: 480px;
  }
  .hex-auth__logo-box {
    width: 120px;
    height: 120px;
  }
  .hex-auth__logo-img {
    width: 88px;
    height: 88px;
  }
  .hex-auth__card {
    max-width: 440px;
    padding: 36px 32px;
  }
}

/* Tablet / Medium Screens */
@media (max-width: 1024px) {
  .hex-auth__layout {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .hex-auth__brand-heading {
    font-size: 32px;
  }
}

/* Mobile Screens (< 768px): Single Column Stacked */
@media (max-width: 768px) {
  #hex-auth-screen {
    align-items: flex-start;
  }
  .hex-auth__viewport {
    padding: 24px 16px 40px 16px;
    min-height: auto;
  }
  .hex-auth__layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hex-auth__brand-section {
    padding: 12px 8px;
  }
  .hex-auth__logo-box {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    margin-bottom: 16px;
  }
  .hex-auth__logo-img {
    width: 58px;
    height: 58px;
  }
  .hex-auth__brand-heading {
    font-size: 26px;
    margin-bottom: 8px;
  }
  .hex-auth__brand-desc {
    font-size: 12px;
    margin-bottom: 18px;
  }
  .hex-auth__badges {
    gap: 8px;
  }
  .hex-auth__badge-pill {
    padding: 6px 11px;
    font-size: 10.5px;
  }
  .hex-auth__card {
    max-width: 100%;
    padding: 24px 20px;
    border-radius: 20px;
  }
  .hex-auth__dev-divider {
    margin-bottom: 12px;
  }
  .hex-auth__dev-credit {
    font-size: 11px;
  }
}

/* --------------------------------------------------------------------------
   6. PREMIUM DEVELOPER CREDIT (LOGIN & SIGNUP FOOTER)
   -------------------------------------------------------------------------- */
.hex-auth__dev-credit-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0;
  box-sizing: border-box;
}

.hex-auth__dev-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  margin: 0 0 14px 0;
}

.hex-auth__dev-credit {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-align: center;
  color: #7C8798;
  line-height: 1.4;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: default;
  transition: color 200ms ease;
  white-space: nowrap;
}

.hex-auth__dev-name {
  color: #FF1744;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: inline-block;
  transition: color 200ms ease, text-shadow 200ms ease, transform 200ms ease;
}

.hex-auth__dev-credit:hover .hex-auth__dev-name {
  color: #FF1744;
  text-shadow: 0 0 10px rgba(255, 23, 68, 0.65), 0 0 20px rgba(255, 23, 68, 0.35);
  transform: translateY(-0.5px);
}

.hex-auth__dev-credit:hover {
  color: #94A3B8;
}
