/**
 * Auth Forms - Modern CSS Framework
 * Maintains the gaming aesthetic with clean, maintainable code
 */

/* ================================
   RESET & BASE
   ================================ */

.auth-page {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  color: #000;
  line-height: 1.5;
}

.auth-page * {
  box-sizing: border-box;
}

/* Fake fields for browser autofill workaround */
.auth-fake-field {
  display: none !important;
  position: absolute;
  left: -9999px;
}

/* ================================
   LOGIN PAGE (integrated with the existing game frame)
   Palette follows the account area: deep teal, gold trim, stone buttons.
   ================================ */

.auth-page--login {
  padding: 32px 20px 28px;
}

.login {
  max-width: 420px;
  margin: 0 auto;
}

/* The site's ornate content frame is the only container. */
.login__head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 24px;
  margin-bottom: 26px;
  border-bottom: 1px solid #a88a4c;
}

.login__crest {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border: 2px solid #a88a4c;
  border-radius: 50%;
  overflow: hidden;
  background: #173d3b;
  box-shadow: 0 0 0 3px rgba(168, 138, 76, 0.14);
}

.login__crest img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login__intro {
  min-width: 0;
}

.login__title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: #173d3b;
}

.login__subtitle {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: #505b5b;
}

.auth-page--login .login__form {
  width: 100%;
  margin: 0;
  padding: 0;
}

.login__alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #e6a5a0;
  border-radius: 4px;
  background: #fdecea;
  color: #8f1d17;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
}

.login__alert[hidden] {
  display: none;
}

.login__alert i {
  margin-top: 2px;
}

.login__field {
  margin: 0 0 16px;
}

.auth-page--login .login__label {
  display: block;
  float: none;
  width: auto;
  margin: 0 0 6px;
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #3b4a4d;
}

.login__link {
  display: block;
  width: fit-content;
  margin: 8px 0 0 auto;
  font-size: 12.5px;
  font-weight: 600;
  color: #1f6f6a;
  text-decoration: none;
}

.login__link:hover {
  text-decoration: underline;
}

.login__control {
  position: relative;
}

.login__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a949a;
  font-size: 14px;
  pointer-events: none;
  transition: color 0.15s ease;
}

.login__control:focus-within .login__icon {
  color: #1f4d4a;
}

.auth-page--login .login__input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 46px;
  margin: 0;
  padding: 0 44px 0 40px;
  border: 1px solid #b9b3a6;
  border-radius: 4px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
  color: #1d2a2c;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.3px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-page--login .login__input:focus {
  outline: none;
  border-color: #c9a227;
  box-shadow:
    0 0 0 3px rgba(201, 162, 39, 0.3),
    inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.login__control.is-invalid .login__input {
  border-color: #c62828;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.18);
}

.login__control.is-invalid .login__icon {
  color: #c62828;
}

.login__reveal {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #7a8488;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.login__reveal:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1f4d4a;
}

.login__reveal:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.5);
}

.auth-page--login .login__submit {
  --btn-top: #e4c879;
  --btn-bottom: #b58b3e;
  --btn-frame: #f0dba0;
  --btn-frame-dark: #705326;
  --btn-text: #30220f;
  min-height: 50px;
  margin-top: 8px;
  border-radius: 3px;
  font-size: 15px;
  letter-spacing: 1.4px;
  box-shadow:
    0 0 0 1px var(--btn-frame-dark),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -2px 0 rgba(87, 55, 16, 0.3),
    0 3px 5px rgba(53, 40, 18, 0.18);
}

.auth-page--login .login__submit:hover {
  filter: brightness(1.08);
}

.auth-page--login .login__submit:active {
  transform: translateY(1px);
  box-shadow: 0 0 0 1px var(--btn-frame-dark), inset 0 2px 5px rgba(53, 40, 18, 0.4);
}

.auth-page--login .login__submit:focus-visible,
.login__register:focus-visible,
.login__link:focus-visible {
  outline: 2px solid #1f4d4a;
  outline-offset: 4px;
}

.login__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  margin-top: 20px;
}

.login__foot-text {
  font-size: 13.5px;
  color: #a3b8b5;
}

.login__register {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: #1f5954;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
}

.login__register:hover {
  color: #173d3b;
  text-decoration: underline;
}

.login__trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin: 20px auto 0;
  padding: 16px 0 0;
  border-top: 1px solid rgba(31, 77, 74, 0.15);
  list-style: none;
  text-align: center;
  font-size: 12px;
  color: #505b5b;
}

.login__trust i {
  margin-right: 5px;
  color: #1f6f6a;
}

@media (max-width: 520px) {
  .auth-page--login {
    padding: 24px 12px;
  }

  .login__head {
    gap: 12px;
  }

  .login__title {
    font-size: 21px;
  }
}

/* ================================
   LOST ACCOUNT / RESET PASSWORD (reuses the login card)
   ================================ */

.recover__tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 20px;
  padding: 4px;
  border: 1px solid #cfc6b3;
  border-radius: 6px;
  background: rgba(23, 61, 59, 0.06);
}

.recover__tab {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 4px;
  color: #3b4a4d;
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.recover__tab:hover {
  color: #173d3b;
  background: rgba(23, 61, 59, 0.08);
}

.recover__tab[aria-selected="true"] {
  background: #173d3b;
  color: #f0dba0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.recover__tab:focus-visible {
  outline: 2px solid #c9a227;
  outline-offset: 2px;
}

.recover__lead {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #505b5b;
}

.recover__help,
.recover__error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: #a3b8b5;
}

.recover__error {
  color: #ff7a6e;
  font-weight: 600;
}

.recover__error:empty {
  display: none;
}

.auth-page--login .recover__key-input {
  font-family: "Courier New", monospace;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.recover__notice {
  padding: 20px;
  border: 1px solid #cfc6b3;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
  font-size: 13.5px;
  line-height: 1.55;
  color: #3b4a4d;
}

.recover__notice p {
  margin: 0 0 10px;
}

.recover__notice a:not(.ui-btn) {
  color: #1f6f6a;
  font-weight: 700;
}

.recover__notice-icon {
  display: block;
  margin: 0 auto 10px;
  font-size: 30px;
  color: #1f6f6a;
}

.recover__notice-title {
  margin: 0 0 8px;
  font-size: 18px;
  color: #173d3b;
}

.login__trust a {
  color: #1f6f6a;
  font-weight: 600;
}

.recover__optional {
  font-weight: 400;
  color: #a3b8b5;
}

.auth-page--login textarea.recover__textarea {
  height: auto;
  min-height: 110px;
  padding: 10px 12px;
  line-height: 1.45;
  resize: vertical;
}

.recover__steps {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  line-height: 1.5;
  color: #3b4a4d;
}

.recover__steps li {
  display: flex;
  gap: 10px;
  margin: 0 0 8px;
}

.recover__steps i {
  flex: none;
  width: 16px;
  margin-top: 3px;
  color: #1f6f6a;
  text-align: center;
}

@media (max-width: 520px) {
  .recover__tab {
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px;
    font-size: 12px;
  }
}

/* Notices on the dark content area (expired/used links, "check your inbox", results).
   The colour follows the icon: amber for expired or used, green for done, teal otherwise. */
#page .recover__notice {
  --c: #6fd3c4;
  position: relative;
  overflow: hidden;
  padding: 26px 24px 22px;
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  border-radius: 12px;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--c) 12%, #1d2a2c) 0%, #172123 55%, #121819 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 26px rgba(0, 0, 0, 0.35);
  color: #c9d8d5;
}
#page .recover__notice:has(.fa-hourglass-end, .fa-hourglass-half) { --c: #f6c85a; }
#page .recover__notice:has(.fa-check-circle) { --c: #5dea6f; }
#page .recover__notice::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--c), transparent);
}
#page .recover__notice-icon {
  display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--c) 22%, transparent);
  color: var(--c); font-size: 24px;
}
#page .recover__notice-title { color: #fff; }
#page .recover__notice p { margin: 0 0 18px; color: #c9d8d5; font-size: 14px; line-height: 1.6; }
#page .recover__notice a:not(.ui-btn) { color: #6fd3c4; }
#page .recover__notice a:not(.ui-btn):hover { color: #f6c85a; }
#page .recover__notice .ui-btn { margin-top: 2px; }

/* ================================
   CREATE ACCOUNT (reuses the login card)
   ================================ */

.login--wide {
  max-width: 540px;
}

.signup__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  align-items: start;
}

/* a help line replaced by its error, so the form does not grow when a field fails */
.login__field:has(.recover__error:not(:empty)) .recover__help {
  display: none;
}

.signup__captcha {
  display: flex;
  align-items: center;
  gap: 12px;
}

.signup__captcha-image img {
  display: block;
  height: 46px;
  width: auto;
  border-radius: 4px;
}

.signup__captcha .login__control {
  flex: 1 1 auto;
}

#page .signup__terms {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: #a3b8b5;
}

.signup__terms a {
  font-weight: 600;
}

.auth-page--login .login__submit[disabled] {
  filter: saturate(0.6) brightness(0.9);
  cursor: progress;
}

@media (max-width: 520px) {
  .signup__pair {
    grid-template-columns: 1fr;
  }
}

/* Searchable country picker (country-combo.js) */
.combo__native[hidden] {
  display: none;
}

.auth-page--login .combo__input {
  padding-right: 36px;
  text-overflow: ellipsis;
  cursor: pointer;
}

.combo.is-open .combo__input {
  cursor: text;
}

/* sits where the other fields have their icon, centred on the text line */
.combo__flag {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 12px;
  margin-top: -6px;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.combo__flag[hidden] {
  display: none;
}

.combo__caret {
  position: absolute;
  right: 14px;
  top: 50%;
  margin-top: -6px;
  font-size: 12px;
  color: #8fa9a5;
  pointer-events: none;
  transition: transform 0.15s ease;
}

.combo.is-open .combo__caret {
  transform: rotate(180deg);
}

#page .combo__list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 264px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  border: 1px solid rgba(143, 196, 190, 0.35);
  border-radius: 6px;
  background: #1a2628;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
  scrollbar-width: thin;
  scrollbar-color: #3c5557 transparent;
}

.combo__list[hidden] {
  display: none;
}

#page .combo__option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin: 0;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.2;
  color: #d9e6e4;
  cursor: pointer;
}

.combo__option[hidden] {
  display: none !important;
}

#page .combo__option.is-active {
  background: #2b4447;
  color: #fff;
}

.combo__option-flag {
  flex: none;
  display: block;
  width: 18px;
  height: 12px;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.combo__option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#page .combo__empty {
  padding: 10px;
  font-size: 13px;
  color: #a3b8b5;
}

.combo__empty[hidden] {
  display: none;
}
