/**
 * 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;
}

/* ================================
   LAYOUT - PAGE HEADER
   ================================ */

.auth-header {
  display: flex;
  width: 100%;
  height: 150px;
  margin-bottom: 20px;
}

.auth-header__icon {
  flex-shrink: 0;
  width: 146px;
  height: 150px;
  background-image: url('/lay/manage.jpg');
  background-size: cover;
  background-position: center;
}

.auth-header__content {
  flex: 1;
  padding: 20px 0 0 20px;
}

.auth-header__title {
  margin: 0 0 10px 0;
  font-size: 30px;
  font-weight: 400;
}

.auth-header__divider {
  margin: 0 0 10px 0;
  border: none;
  border-bottom: 1px solid #ccc;
  display: block;
}

.auth-header__breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  font-size: 14px;
  line-height: 19px;
}

.auth-header__breadcrumb img {
  width: 16px;
  height: auto;
}

.auth-header__breadcrumb a {
  color: #0089f6;
  text-decoration: none;
}

.auth-header__breadcrumb a:hover {
  color: #03a9f4;
}

/* ================================
   FORMS - BASE STRUCTURE
   ================================ */

.auth-form {
  width: 100%;
  margin: 0;
}

.auth-form__row {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  position: relative;
}

.auth-form__label {
  flex-shrink: 0;
  width: 180px;
  padding-left: 33px;
  font-weight: bold;
  text-align: left;
}

.auth-form__input-wrapper {
  flex: 1;
  max-width: 350px;
}

/* ================================
   FORMS - INPUT ELEMENTS
   ================================ */

.auth-input {
  width: 100%;
  padding: 8px 12px;
  height: 30px;
  border: 1px solid rgba(138, 138, 138, 0.98);
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  background-repeat: no-repeat;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: #0089f6;
  box-shadow: 0 0 0 2px rgba(0, 137, 246, 0.1);
}

.auth-input::placeholder {
  color: #999;
}

/* Input validation states */
.auth-input.is-valid {
  border-color: #4caf50;
  box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.auth-input.is-invalid {
  border-color: #f44336;
  box-shadow: 0 0 5px rgba(244, 67, 54, 0.3);
}

.auth-select {
  width: 100%;
  max-width: 350px;
  padding: 6px 12px;
  height: 30px;
  border: 1px solid rgba(138, 138, 138, 0.98);
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  background-repeat: no-repeat;
}

.auth-select:focus {
  outline: none;
  border-color: #0089f6;
}

/* ================================
   FORMS - ACTIONS & BUTTONS
   ================================ */

.auth-form__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 20px 0 20px 146px;
  flex-wrap: wrap;
}

/* ================================
   BUTTONS - Reusable throughout app
   ================================ */

.btn-primary {
  position: relative;
  display: inline-block;
  width: 182px;
  height: 71px;
  background: url(/template/images/button-bg.png) no-repeat left bottom;
  background-size: contain;
  line-height: 71px;
  text-align: center;
  text-decoration: none;
  text-shadow: 2px 1px 0px rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: normal;
  transition: transform 0.1s, opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.9;
  text-decoration: none;
  color: #ffffff;
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Legacy compatibility - will be removed in future */
.auth-btn {
  /* Alias for btn-primary for backward compatibility */
  position: relative;
  display: inline-block;
  width: 182px;
  height: 71px;
  background: url(/template/images/button-bg.png) no-repeat left bottom;
  background-size: contain;
  line-height: 71px;
  text-align: center;
  text-decoration: none;
  text-shadow: 2px 1px 0px rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: normal;
  transition: transform 0.1s, opacity 0.2s;
}

.auth-btn:hover {
  opacity: 0.9;
  text-decoration: none;
  color: #ffffff;
}

.auth-btn:active {
  transform: translateY(2px);
}

.auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ================================
   FORMS - LINKS & MESSAGES
   ================================ */

.auth-links {
  margin-top: 20px;
  text-align: left;
}

.auth-link {
  display: block;
  margin: 10px 0;
  color: #0089f6;
  text-decoration: none;
  font-weight: 500;
}

.auth-link:hover {
  color: #03a9f4;
  text-decoration: underline;
}

.auth-link--centered {
  text-align: center;
}

.auth-link--spaced {
  margin-left: 150px;
}

/* Error messages */
.auth-error {
  display: none;
  margin-top: 8px;
  margin-left: 182px;
  color: #f44336;
  font-weight: bold;
  font-size: 13px;
}

.auth-error.is-visible {
  display: block;
}

/* ================================
   TABLE/BOX COMPONENT
   ================================ */

.auth-table {
  background-image: url(/template/images/table-bg.jpg);
  background-size: cover;
  font-size: 14px;
  width: 100%;
  border: 1px solid black;
  padding: 20px;
  box-shadow: 0 0 1px 1px black;
  margin-bottom: 20px;
}

.auth-table__title {
  margin: 5px 0;
  padding: 5px;
  font-size: 16px;
  font-weight: bold;
  color: #8b4513;
  text-decoration: underline;
}

.auth-table__text {
  padding: 7px;
  line-height: 1.6;
}

.auth-table__text--highlight {
  color: #8b4513;
  text-decoration: underline;
  font-weight: 300;
}

/* ================================
   RADIO GROUPS
   ================================ */

.auth-radio-group {
  margin: 15px 0;
  line-height: 1.6;
}

.auth-radio-option {
  display: block;
  margin: 12px 0;
  line-height: 1.6;
}

.auth-radio-option label {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: normal;
  width: 100%;
}

.auth-radio-option input[type="radio"] {
  flex-shrink: 0;
  width: auto;
  height: auto;
  margin: 4px 0 0 0;
  cursor: pointer;
}

.auth-radio-option label span {
  flex: 1;
  display: inline-block;
}

/* ================================
   REGISTER PAGE SPECIFIC
   ================================ */

.auth-page--register {
  max-width: 800px;
  margin: 0 auto;
}

.auth-form__help {
  margin: 8px 0 0 0;
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

.auth-form__agreement {
  margin: 20px 0 20px 180px;
  font-size: 14px;
}

.auth-form__agreement a {
  color: #0089f6;
  text-decoration: none;
}

.auth-form__agreement a:hover {
  color: #03a9f4;
  text-decoration: underline;
}

.auth-form__submit {
  text-align: center;
  margin: 20px 0;
}

.auth-submit-image {
  cursor: pointer;
  border: none;
  padding: 0;
  max-width: 200px;
  height: auto;
}

.auth-submit-image:hover {
  opacity: 0.9;
}

.auth-captcha {
  margin-bottom: 10px;
}

.auth-captcha img {
  border: 0;
  display: block;
}

.auth-input--captcha {
  text-align: center;
  max-width: 220px;
}

/* Country select with flag */
.auth-select--country {
  background-position: 304px 7px;
  background-repeat: no-repeat;
  padding-right: 50px;
}

/* ================================
   UTILITY CLASSES
   ================================ */

.auth-separator {
  clear: both;
  height: 20px;
}

.auth-text-center {
  text-align: center;
}

.auth-hidden {
  display: none;
}

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

/* ================================
   LOADING SPINNER
   ================================ */

.auth-loader {
  display: none;
  justify-content: center;
  padding: 20px 0;
}

.auth-loader.is-active {
  display: flex;
}

.auth-loader__spinner {
  border: 10px solid #f3f3f3;
  border-radius: 50%;
  border-top: 10px solid #32cd32;
  border-bottom: 10px solid #32cd32;
  width: 60px;
  height: 60px;
  animation: auth-spin 2s linear infinite;
}

@keyframes auth-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ================================
   RESPONSIVE ADJUSTMENTS
   ================================ */

@media (max-width: 768px) {
  .auth-header {
    flex-direction: column;
    height: auto;
  }

  .auth-header__icon {
    width: 100%;
    height: 100px;
  }

  .auth-header__content {
    padding: 15px;
  }

  .auth-form__row {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-form__label {
    width: 100%;
    padding-left: 0;
    margin-bottom: 5px;
  }

  .auth-form__input-wrapper {
    width: 100%;
    max-width: 100%;
  }

  .auth-input,
  .auth-select {
    max-width: 100%;
  }

  .auth-form__actions {
    margin-left: 0;
    justify-content: center;
  }

  .auth-link--spaced {
    margin-left: 0;
    text-align: center;
  }

  .auth-error {
    margin-left: 0;
  }

  .auth-form__agreement {
    margin-left: 0;
  }

  .auth-form__help {
    margin-left: 0;
  }

  .auth-select--country {
    background-position: calc(100% - 10px) 7px;
  }
}

/* ================================
   LEGACY COMPATIBILITY
   ================================ */

/* Support for old .form class */
form.form .auth-form__row {
  /* Maintains compatibility if .form class is still used */
}

