/* =========================================================
   1. RESET, DESIGN TOKENS & BASE CANVAS
   ========================================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --gold: #f7c95e;
  --gold-light: #ffe9a6;
  --gold-dark: #d49a24;
  --purple-deep: #100719;
  --card-bg: rgba(20, 7, 29, 0.94);
  --muted: #bcb0ca;
  --line: rgba(255, 255, 255, 0.13);
  --error: #ff7285;
}

html {
  min-height: 100%;
  background: var(--purple-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  padding: 30px 20px;
  color: #fff;
  background: var(--purple-deep);
  font-family: 'Inter', Arial, sans-serif;
}

/* =========================================================
   2. BACKGROUND ARTWORK & ATMOSPHERE SHADES
   ========================================================= */
.background-layer,
.background-shade,
.decor-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.background-layer {
  z-index: -4;
  background-image: url("casino-bg.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.02);
}

.background-shade {
  z-index: -3;
  background: 
    radial-gradient(circle at 50% 50%, rgba(247, 201, 94, 0.08), transparent 70%),
    linear-gradient(90deg, rgba(13, 3, 20, 0.45), rgba(12, 3, 19, 0.75) 48%, rgba(10, 3, 17, 0.85)),
    linear-gradient(0deg, rgba(8, 2, 14, 0.8), transparent 50%, rgba(8, 2, 14, 0.4));
}

.decor-layer {
  z-index: -1;
  overflow: hidden;
}

/* =========================================================
   3. LOGIN STAGE & CARD WITH PATTERN
   ========================================================= */
.login-stage {
  width: min(100%, 490px);
  position: relative;
  z-index: 2;
  margin: auto;
}

.login-card {
  position: relative;
  overflow: hidden;
  padding: 34px 40px 24px;
  border-radius: 22px;
  border: 1px solid rgba(255, 210, 103, 0.7);
  background: linear-gradient(145deg, var(--card-bg), rgba(14, 6, 23, 0.94));
  box-shadow: 
    0 0 0 1px rgba(255, 191, 63, 0.15),
    0 24px 75px rgba(0, 0, 0, 0.75),
    0 0 50px rgba(255, 169, 44, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* Geometric Casino Pattern Overlay */
.login-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background-image: 
    radial-gradient(rgba(247, 201, 94, 0.08) 1px, transparent 1px),
    repeating-linear-gradient(45deg, rgba(247, 201, 94, 0.025) 0, rgba(247, 201, 94, 0.025) 1px, transparent 0, transparent 16px);
  background-size: 16px 16px, 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* Inner decorative accent border */
.login-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 208, 106, 0.15);
  border-radius: 16px;
  pointer-events: none;
  z-index: 1;
}

/* Keep all interactive form elements above patterns */
.login-card > * {
  position: relative;
  z-index: 2;
}

.card-topline {
  position: absolute;
  left: 15%;
  right: 15%;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-light), #ff9e28, transparent);
  box-shadow: 0 0 18px #ffba4b;
}

/* =========================================================
   4. BRANDING & HEADINGS
   ========================================================= */
.brand-crown {
  text-align: center;
  color: var(--gold);
  font-size: 32px;
  line-height: 1;
  text-shadow: 0 0 20px rgba(248, 189, 78, 0.5);
  margin: 0 0 8px;
}

.overline {
  text-align: center;
  color: var(--gold-light);
  font-size: 9px;
  letter-spacing: 4px;
  font-weight: 700;
  margin: 0 0 10px;
}

h1 {
  font-family: 'Orbitron', sans-serif;
  text-align: center;
  font-size: clamp(26px, 5vw, 36px);
  letter-spacing: 1.5px;
  line-height: 1.2;
  margin: 0;
  color: #fff;
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.9);
}

h1 span {
  color: var(--gold);
  text-shadow: 0 0 24px rgba(255, 183, 45, 0.35);
}

.subtitle {
  text-align: center;
  color: #b8a9c8;
  font-size: 9px;
  letter-spacing: 1.8px;
  margin: 11px 0 25px;
}

.step-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 17px;
}

.step-light {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}

.form-heading h2 {
  font-size: 24px;
  letter-spacing: -0.5px;
  margin: 0 0 7px;
  text-align: left;
}

.form-heading p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 23px;
}

form > label {
  display: block;
  color: #e0d5e8;
  font-size: 9px;
  letter-spacing: 1.6px;
  font-weight: 700;
  margin: 0 0 8px;
}

/* =========================================================
   5. INPUT WRAPPERS, HOVER & TYPING GLOW STYLES
   ========================================================= */
.input-wrap {
  height: 52px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  margin-bottom: 17px;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.field-icon {
  width: 45px;
  text-align: center;
  color: var(--gold);
  font-size: 19px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.input-wrap input {
  height: 100%;
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  padding: 0 6px;
  caret-color: var(--gold);
}

.input-wrap input::placeholder {
  color: #85788f;
  transition: opacity 0.2s ease;
}

/* Hover State */
.input-wrap:hover {
  border-color: rgba(247, 201, 94, 0.55);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), 0 0 14px rgba(247, 201, 94, 0.15);
}

.input-wrap:hover .field-icon {
  color: var(--gold-light);
  transform: scale(1.08);
}

/* Focus & Active Typing State */
.input-wrap:focus-within {
  border-color: var(--gold) !important;
  background: rgba(16, 7, 25, 0.88);
  outline: 2px solid rgba(247, 201, 94, 0.35);
  outline-offset: 1px;
  box-shadow: 
    0 0 0 4px rgba(247, 201, 94, 0.18),
    0 8px 24px rgba(0, 0, 0, 0.5),
    inset 0 0 12px rgba(247, 201, 94, 0.08);
}

.input-wrap:focus-within .field-icon {
  color: #fff;
  text-shadow: 0 0 12px var(--gold);
}

.input-wrap input:focus::placeholder {
  opacity: 0.5;
}

/* Active typing feedback when field contains characters */
.input-wrap input:not(:placeholder-shown) {
  font-weight: 500;
  color: #ffffff;
}

.input-wrap:has(input[type="password"]:not(:placeholder-shown)) {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(247, 201, 94, 0.22), 0 0 18px rgba(247, 201, 94, 0.2);
}

.reveal {
  height: 100%;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.reveal:hover {
  color: var(--gold-light);
  text-shadow: 0 0 8px var(--gold);
}

/* =========================================================
   6. FORM OPTIONS, BUTTONS & FOOTER
   ========================================================= */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1px 0 13px;
  font-size: 11px;
  color: #c7b9d2;
}

.remember {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.remember input {
  accent-color: var(--gold);
  width: 15px;
  height: 15px;
  margin: 0;
}

.secure-label {
  font-size: 8px;
  letter-spacing: 1px;
  color: #e8c878;
}

.inline-error {
  min-height: 15px;
  margin: 0 0 9px;
  color: var(--error);
  font-size: 11px;
}

.primary-btn {
  position: relative;
  width: 100%;
  min-height: 53px;
  border: 1px solid #ffdc82;
  border-radius: 10px;
  background: linear-gradient(105deg, #f1b83e, #ffe38a 48%, #efa929);
  color: #29152a;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.9px;
  cursor: pointer;
  box-shadow: 0 5px 24px rgba(245, 184, 59, 0.25), inset 0 1px rgba(255, 255, 255, 0.5);
  transition: transform 0.18s, filter 0.18s, box-shadow 0.18s;
}

.primary-btn span {
  position: absolute;
  right: 17px;
  font-size: 18px;
  top: 50%;
  transform: translateY(-52%);
  transition: transform 0.2s ease;
}

.primary-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 8px 30px rgba(245, 184, 59, 0.35);
}

.primary-btn:hover span {
  transform: translate(3px, -52%);
}

.primary-btn:active {
  transform: translateY(0);
}

.or-line {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9c8ba9;
  font-size: 8px;
  letter-spacing: 2px;
  margin: 18px 0;
}

.or-line::before,
.or-line::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(184, 139, 67, 0.66), transparent);
}

.security-pills {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.security-pills span {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 30px;
  padding: 8px 12px;
  font-size: 8px;
  letter-spacing: 1px;
  color: #c8b6d3;
  background: rgba(255, 255, 255, 0.03);
}

/* OTP Form */
.hidden {
  display: none !important;
}

.otp-emblem {
  width: 47px;
  height: 47px;
  border: 1px solid rgba(247, 201, 94, 0.46);
  border-radius: 14px;
  background: rgba(247, 201, 94, 0.08);
  color: var(--gold);
  font-size: 27px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.otp-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
  margin: 0 0 22px;
}

.otp-description strong {
  color: var(--gold-light);
}

.otp-input {
  width: 100%;
  height: 62px;
  margin: 0 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: #0b0610;
  color: #fff;
  outline: 0;
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  letter-spacing: 9px;
  transition: all 0.25s ease;
}

.otp-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(247, 201, 94, 0.18), 0 0 20px rgba(247, 201, 94, 0.2);
}

.otp-input::placeholder {
  color: #776780;
}

.text-btn {
  display: block;
  margin: 15px auto 0;
  border: 0;
  background: transparent;
  color: #c7b7d2;
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s ease;
}

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

.demo-note {
  font-size: 10px;
  color: #eac568;
  text-align: center;
  line-height: 1.5;
  margin: 13px 0 0;
}

.card-footer {
  position: relative;
  margin-top: 24px;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  color: #9687a3;
  font-size: 9px;
  letter-spacing: 0.3px;
}

.card-footer > span:not(.footer-lock) {
  padding: 0 7px;
  color: var(--gold);
}

.footer-lock {
  color: var(--gold);
  margin-right: 5px;
}

/* =========================================================
   7. FLOATING CARDS, DICE & CHIPS (ANIMATIONS & HOVER)
   ========================================================= */
@keyframes floatA {
  0%, 100% {
    transform: translateY(0px) rotate(var(--rot, 0deg));
  }
  50% {
    transform: translateY(-10px) rotate(calc(var(--rot, 0deg) + 2.5deg));
  }
}

@keyframes floatB {
  0%, 100% {
    transform: translateY(0px) rotate(var(--rot, 0deg));
  }
  50% {
    transform: translateY(-14px) rotate(calc(var(--rot, 0deg) - 2deg));
  }
}

/* Playing Cards */
.float-card {
  position: absolute;
  width: 75px;
  height: 108px;
  border: 1px solid rgba(255, 216, 120, 0.78);
  border-radius: 9px;
  background: linear-gradient(145deg, #fff8df, #e5d3a5);
  color: #25132d;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto !important;
  cursor: pointer;
  transition: box-shadow 0.3s ease, filter 0.3s ease;
  will-change: transform;
}

.float-card span {
  position: absolute;
  top: 6px;
  left: 8px;
  font-family: Georgia, serif;
  font-size: 15px;
}

.float-card b {
  font-family: Georgia, serif;
  font-size: 39px;
}

.float-card small {
  position: absolute;
  bottom: 5px;
  right: 8px;
  font-family: Georgia, serif;
  font-size: 15px;
  transform: rotate(180deg);
}

.card-left {
  --rot: -17deg;
  left: calc(50% - 350px);
  top: 25%;
  animation: floatA 5s ease-in-out infinite;
}
.card-left b { color: #1b1622; }

.card-right {
  --rot: 16deg;
  right: calc(50% - 350px);
  top: 22%;
  animation: floatB 6s ease-in-out infinite 0.5s;
}
.card-right b { color: #c52338; }

.card-bottom {
  --rot: 12deg;
  left: calc(50% - 300px);
  bottom: 15%;
  animation: floatA 5.5s ease-in-out infinite 1s;
}
.card-bottom b { color: #b8273b; }

/* 3D-Look Dice */
.dice {
  position: absolute;
  width: 56px;
  height: 56px;
  border: 1px solid #ffe09a;
  border-radius: 12px;
  background: linear-gradient(145deg, #3d194b, #140a20 72%);
  box-shadow: inset 0 0 14px rgba(244, 184, 61, 0.2), 0 12px 25px rgba(0, 0, 0, 0.6);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 9px;
  gap: 3px;
  pointer-events: auto !important;
  cursor: pointer;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  will-change: transform;
}

.dice i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(247, 201, 94, 0.8);
  align-self: center;
  justify-self: center;
}

.dice-one i:nth-child(1) { grid-area: 1 / 1; }
.dice-one i:nth-child(2) { grid-area: 1 / 3; }
.dice-one i:nth-child(3) { grid-area: 2 / 2; }
.dice-one i:nth-child(4) { grid-area: 3 / 1; }
.dice-one i:nth-child(5) { grid-area: 3 / 3; }
.dice-one i:nth-child(6) { display: none; }

.dice-two i:nth-child(1) { grid-area: 1 / 1; }
.dice-two i:nth-child(2) { grid-area: 1 / 2; }
.dice-two i:nth-child(3) { grid-area: 1 / 3; }
.dice-two i:nth-child(4) { grid-area: 3 / 1; }
.dice-two i:nth-child(5) { grid-area: 3 / 2; }
.dice-two i:nth-child(6) { grid-area: 3 / 3; }

.dice-one {
  --rot: -18deg;
  left: calc(50% - 390px);
  bottom: 27%;
  animation: floatB 4.6s ease-in-out infinite 0.3s;
}

.dice-two {
  --rot: 17deg;
  right: calc(50% - 390px);
  bottom: 23%;
  animation: floatA 5.2s ease-in-out infinite 1.2s;
}

/* Casino Chips */
.mini-chip {
  position: absolute;
  width: 45px;
  height: 45px;
  border: 4px dotted #ffda7d;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffe39a;
  background: radial-gradient(circle, #572044, #180b25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(247, 201, 94, 0.2);
  font-size: 21px;
  pointer-events: auto !important;
  cursor: pointer;
  transition: box-shadow 0.3s ease;
  will-change: transform;
}

.chip-one {
  --rot: -12deg;
  left: calc(50% - 280px);
  top: 54%;
  animation: floatA 4.8s ease-in-out infinite 0.7s;
}

.chip-two {
  --rot: 15deg;
  right: calc(50% - 285px);
  top: 53%;
  animation: floatB 5.6s ease-in-out infinite 1.4s;
}

/* Floating Elements Hover Overrides */
.float-card:hover {
  animation-play-state: paused;
  transform: translateY(-12px) rotate(calc(var(--rot) + 4deg)) scale(1.08) !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), 0 0 22px rgba(247, 201, 94, 0.4);
}

.dice:hover {
  animation-play-state: paused;
  transform: translateY(-10px) rotate(calc(var(--rot) - 8deg)) scale(1.12) !important;
  box-shadow: inset 0 0 18px rgba(247, 201, 94, 0.5), 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 20px rgba(247, 201, 94, 0.35);
  border-color: var(--gold-light);
}

.mini-chip:hover {
  animation-play-state: paused;
  transform: translateY(-8px) rotate(calc(var(--rot) + 12deg)) scale(1.15) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 24px rgba(247, 201, 94, 0.5);
}

/* =========================================================
   8. RESPONSIVE DESIGN (TABLETS & PHONES)
   ========================================================= */
@media (max-width: 900px) {
  .float-card, .dice, .mini-chip {
    opacity: 0.72;
    transform: scale(0.85);
  }
  .card-left { left: 3%; top: 8%; }
  .card-right { right: 3%; top: 9%; }
  .card-bottom { left: 4%; bottom: 8%; }
  .dice-one { left: 3%; bottom: 22%; }
  .dice-two { right: 3%; bottom: 20%; }
  .chip-one { left: 5%; top: 48%; }
  .chip-two { right: 5%; top: 48%; }
}

@media (max-width: 600px) {
  body {
    padding: 24px 14px;
  }
  .login-stage {
    width: min(100%, 420px);
  }
  .login-card {
    padding: 28px 22px 20px;
    border-radius: 18px;
  }
  .brand-crown {
    font-size: 28px;
  }
  h1 {
    font-size: clamp(24px, 7vw, 30px);
  }
  .subtitle {
    font-size: 8px;
    letter-spacing: 1.1px;
    margin-bottom: 20px;
  }
  .float-card {
    width: 44px;
    height: 64px;
    border-radius: 6px;
    opacity: 0.5;
  }
  .float-card span { font-size: 10px; top: 3px; left: 4px; }
  .float-card b { font-size: 22px; }
  .float-card small { font-size: 10px; bottom: 3px; right: 4px; }

  .card-left { left: -6px; top: 5%; }
  .card-right { right: -6px; top: 6%; }
  .card-bottom { left: -8px; bottom: 6%; }

  .dice {
    width: 38px;
    height: 38px;
    padding: 5px;
    gap: 2px;
    border-radius: 8px;
    opacity: 0.5;
  }
  .dice i { width: 4px; height: 4px; }
  .dice-one { left: 2px; bottom: 25%; }
  .dice-two { right: 2px; bottom: 22%; }

  .mini-chip {
    width: 32px;
    height: 32px;
    border-width: 3px;
    font-size: 13px;
    opacity: 0.5;
  }
  .chip-one { left: 2px; top: 44%; }
  .chip-two { right: 2px; top: 46%; }
}

@media (max-width: 360px) {
  .login-card {
    padding: 22px 16px 18px;
  }
  .form-options {
    font-size: 10px;
  }
  .primary-btn {
    font-size: 9px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}