/* ========================================
   CSS Variables with fallbacks
   ======================================== */
:root {
  --bg-1: #1a0c06;
  --bg-2: #3d1a0f;
  --bg-3: #6b2c1a;
  --panel-start: #fff8ee;
  --panel-end: #f5e6d3;
  --text: #ffefc8;
  --text-strong: #2e150e;
  --muted: #fbe2a3;
  --accent: #c43c1a;
  --accent-2: #e85a2a;
  --input-bg: #fffdf9;
}

/* ========================================
   Reset & Base
   ======================================== */
* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  font-family: Tahoma, Arial, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #ffefc8;
  background: #1a0c06;
  position: relative;
}

/* ========================================
   Auth Root Container
   ======================================== */
#auth-root {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  z-index: 1;
}

/* ========================================
   Auth Shell - 2 Column Layout
   ======================================== */
.auth-shell {
  width: 1000px;
  max-width: 100%;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  margin: 0 auto;
}

.auth-shell:before,
.auth-shell:after {
  content: "";
  display: table;
}

.auth-shell:after {
  clear: both;
}

/* ========================================
   Hero Panel (Left Side)
   ======================================== */
.hero-panel {
  width: 320px;
  float: left;
  background: -webkit-linear-gradient(165deg, rgba(80, 35, 20, 0.95), rgba(30, 12, 8, 0.98));
  background: linear-gradient(165deg, rgba(80, 35, 20, 0.95), rgba(30, 12, 8, 0.98));
  border-radius: 20px;
  border: 1px solid rgba(255, 200, 150, 0.15);
  padding: 28px 24px;
  position: relative;
  -webkit-box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.hero-panel:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: -webkit-linear-gradient(left, transparent, rgba(255, 180, 100, 0.3), transparent);
  background: linear-gradient(90deg, transparent, rgba(255, 180, 100, 0.3), transparent);
}

/* Brand Logo */
.brand-logo {
  text-align: center;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 180, 100, 0.15);
}

.brand-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  background: -webkit-linear-gradient(315deg, #e85a2a, #c43c1a);
  background: linear-gradient(135deg, #e85a2a, #c43c1a);
  border-radius: 50%;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  font-size: 32px;
  -webkit-box-shadow: 0 8px 24px rgba(200, 60, 26, 0.4);
  box-shadow: 0 8px 24px rgba(200, 60, 26, 0.4);
}

.brand-name {
  margin: 0;
  color: #fbe2a3;
  font-size: 24px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.brand-tagline {
  margin: 6px 0 0;
  color: rgba(255, 220, 180, 0.7);
  font-size: 13px;
}

/* Server Section */
.server-section {
  margin-bottom: 20px;
}

.section-title {
  margin: 0 0 12px;
  color: rgba(255, 230, 200, 0.9);
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.server-badge {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 150, 80, 0.25);
  background: -webkit-linear-gradient(315deg, rgba(200, 60, 26, 0.3), rgba(150, 40, 20, 0.2));
  background: linear-gradient(135deg, rgba(200, 60, 26, 0.3), rgba(150, 40, 20, 0.2));
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

.server-badge:hover {
  border-color: rgba(255, 150, 80, 0.4);
  -webkit-transform: translateY(-2px);
  -ms-transform: translateY(-2px);
  transform: translateY(-2px);
  -webkit-box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.server-status {
  width: 10px;
  height: 10px;
  background: #4ade80;
  border-radius: 50%;
  margin-right: 10px;
  -webkit-box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
  -webkit-animation: blink 2s ease-in-out infinite;
  animation: blink 2s ease-in-out infinite;
}

@-webkit-keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.server-info {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
}

.server-name {
  color: #ffe4b8;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 2px;
}

.server-meta {
  color: rgba(255, 220, 180, 0.6);
  font-size: 11px;
}

/* Tip List */
.tip-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tip-item {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: start;
  -webkit-align-items: flex-start;
  -ms-flex-align: start;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 150, 80, 0.1);
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

.tip-item:last-child {
  margin-bottom: 0;
}

.tip-item:hover {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 150, 80, 0.2);
}

.tip-icon {
  width: 28px;
  height: 28px;
  -webkit-flex-shrink: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  background: -webkit-linear-gradient(315deg, rgba(255, 150, 80, 0.2), rgba(200, 60, 26, 0.2));
  background: linear-gradient(135deg, rgba(255, 150, 80, 0.2), rgba(200, 60, 26, 0.2));
  border-radius: 8px;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  font-size: 14px;
  margin-right: 10px;
}

.tip-content {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
}

.tip-text {
  color: #ffd9a8;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}

/* ========================================
   Auth Card (Right Side)
   ======================================== */
.auth-card {
  width: calc(100% - 320px);
  float: left;
  background: -webkit-linear-gradient(top, #fff8ee, #f5e6d3);
  background: linear-gradient(180deg, #fff8ee, #f5e6d3);
  border-radius: 20px;
  border: 1px solid rgba(255, 200, 150, 0.15);
  padding: 32px;
  color: #2e150e;
  position: relative;
  -webkit-box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Auth Header */
.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.title {
  margin: 0;
  font-size: 28px;
  font-weight: bold;
  color: #2e150e;
}

.subtitle {
  margin: 8px 0 0;
  color: #6b3d2a;
  font-size: 14px;
}

/* ========================================
   Form Styles
   ======================================== */
#auth-form {
  display: block;
}

/* Mode Switch */
.mode-switch {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  padding: 4px;
  background: rgba(100, 60, 40, 0.15);
  border-radius: 14px;
  border: 1px solid rgba(100, 60, 40, 0.2);
  margin-bottom: 20px;
}

.mode-option {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
  cursor: pointer;
}

.mode-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.mode-option span {
  display: block;
  text-align: center;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: bold;
  color: #6b3d2a;
  border-radius: 10px;
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

.mode-option input:checked+span {
  color: #fff;
  background: -webkit-linear-gradient(315deg, #e85a2a, #c43c1a);
  background: linear-gradient(135deg, #e85a2a, #c43c1a);
  -webkit-box-shadow: 0 4px 12px rgba(200, 60, 26, 0.3);
  box-shadow: 0 4px 12px rgba(200, 60, 26, 0.3);
}

.mode-option:hover span {
  background: rgba(200, 60, 26, 0.1);
}

.mode-option input:checked+span:hover {
  background: -webkit-linear-gradient(315deg, #e85a2a, #c43c1a);
  background: linear-gradient(135deg, #e85a2a, #c43c1a);
}

/* Form Row */
.form-row {
  margin-bottom: 20px;
}

.form-row:after {
  content: "";
  display: table;
  clear: both;
}

.form-row .field {
  width: 48%;
  float: left;
}

.form-row .field:last-child {
  float: right;
}

/* Field */
.field {
  margin-bottom: 20px;
}

.field-header {
  margin-bottom: 8px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #5a3020;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* Input Wrapper */
.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.5;
  pointer-events: none;
}

/* Input & Select */
.field input[type="text"],
.field input[type="password"],
.field select {
  width: 100%;
  height: 48px;
  border: 2px solid rgba(100, 60, 40, 0.25);
  background: #fffdf9;
  color: #2e150e;
  border-radius: 12px;
  padding: 0 14px 0 44px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.field input:focus,
.field select:focus {
  border-color: #c43c1a;
  -webkit-box-shadow: 0 0 0 4px rgba(232, 90, 42, 0.2);
  box-shadow: 0 0 0 4px rgba(232, 90, 42, 0.2);
}

.field input:focus+.input-icon,
.field select:focus+.input-icon {
  opacity: 1;
}

.field input::-webkit-input-placeholder {
  color: rgba(100, 60, 40, 0.4);
}

.field input::-moz-placeholder {
  color: rgba(100, 60, 40, 0.4);
}

.field input:-ms-input-placeholder {
  color: rgba(100, 60, 40, 0.4);
}

.field input::placeholder {
  color: rgba(100, 60, 40, 0.4);
}

/* Select Arrow */
.field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b3d2a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px;
}

/* Password Toggle */
.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.5;
  -webkit-transition: opacity 0.3s ease;
  -o-transition: opacity 0.3s ease;
  transition: opacity 0.3s ease;
  border-radius: 6px;
  padding: 0;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
}

.toggle-password:hover {
  opacity: 1;
  background: rgba(100, 60, 40, 0.1);
}

/* Meta Row */
.meta-row {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  -ms-flex-pack: justify;
  justify-content: space-between;
  padding: 4px 0;
  margin-bottom: 20px;
}

.remember-label {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #5a3020;
}

/* Custom Checkbox */
.checkbox-wrapper {
  position: relative;
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

.checkbox-wrapper input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fffdf9;
  border: 2px solid rgba(100, 60, 40, 0.3);
  border-radius: 6px;
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

.checkbox-wrapper input:checked+.checkmark {
  background: -webkit-linear-gradient(315deg, #e85a2a, #c43c1a);
  background: linear-gradient(135deg, #e85a2a, #c43c1a);
  border-color: #c43c1a;
}

.checkmark:after {
  content: '';
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  -webkit-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
}

.checkbox-wrapper input:checked+.checkmark:after {
  display: block;
}

/* Forgot Link */
.forgot-link {
  font-size: 13px;
  font-weight: bold;
  color: #c43c1a;
  text-decoration: none;
  -webkit-transition: color 0.3s ease;
  -o-transition: color 0.3s ease;
  transition: color 0.3s ease;
}

.forgot-link:hover {
  color: #e85a2a;
  text-decoration: underline;
}

/* ========================================
   Actions
   ======================================== */
.actions {
  margin-top: 4px;
}

.btn {
  position: relative;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: bold;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  background: -webkit-linear-gradient(315deg, #e85a2a, #c43c1a);
  background: linear-gradient(135deg, #e85a2a, #c43c1a);
  cursor: pointer;
  overflow: hidden;
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
  -webkit-box-shadow: 0 4px 15px rgba(200, 60, 26, 0.3);
  box-shadow: 0 4px 15px rgba(200, 60, 26, 0.3);
}

.btn:hover {
  -webkit-transform: translateY(-2px);
  -ms-transform: translateY(-2px);
  transform: translateY(-2px);
  -webkit-box-shadow: 0 8px 25px rgba(200, 60, 26, 0.4);
  box-shadow: 0 8px 25px rgba(200, 60, 26, 0.4);
}

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

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  -webkit-transform: none;
  -ms-transform: none;
  transform: none;
}

/* Loading Spinner */
.btn-loading {
  display: inline-block;
  vertical-align: middle;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  -webkit-animation: spin 0.8s linear infinite;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@-webkit-keyframes spin {
  to {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

@keyframes spin {
  to {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

/* ========================================
   Status Messages
   ======================================== */
.status {
  display: none;
  padding: 14px 16px;
  margin-top: 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: bold;
}

.status:not(:empty) {
  display: block;
}

.status-icon {
  margin-right: 8px;
}

.status.ok {
  background: rgba(40, 167, 69, 0.15);
  border: 1px solid rgba(40, 167, 69, 0.3);
  color: #1a7f37;
}

.status.error {
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid rgba(220, 53, 69, 0.3);
  color: #b91c1c;
}

/* ========================================
   Game Root
   ======================================== */
#game-root {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  width: 100%;
  height: 100%;
  background: #14181d;
  z-index: 100;
}

#flashContent {
  width: 100%;
  height: 100%;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 900px) {
  .auth-shell {
    display: block;
    max-width: 480px;
  }

  .hero-panel {
    width: 100%;
    float: none;
    margin-bottom: 20px;
  }

  .auth-card {
    width: 100%;
    float: none;
  }
}

@media (max-width: 520px) {
  #auth-root {
    padding: 12px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .hero-panel {
    padding: 20px;
  }

  .form-row .field {
    width: 100%;
    float: none;
  }

  .form-row .field:last-child {
    float: none;
  }

  .title {
    font-size: 24px;
  }

  .brand-icon {
    width: 60px;
    height: 60px;
    font-size: 26px;
  }

  .brand-name {
    font-size: 20px;
  }
}

/* ========================================
   Screen Reader Only
   ======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
