/* v1.6.0: Auth Pages (register.php, login.php) - Enhanced for mobile */
.auth-page {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 30%, rgba(15,25,50,0.98) 0%, #050510 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

.auth-container {
  width: 100%;
  max-width: 460px;
}

.auth-card {
  background: rgba(15,20,35,0.95);
  border: 1px solid rgba(78,205,196,0.15);
  border-radius: 18px;
  padding: 28px 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(0,212,255,0.05);
  backdrop-filter: blur(10px);
  position: relative;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header img {
  max-width: 220px;
  height: auto;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 12px rgba(0,212,255,0.3));
}

.auth-header h1 {
  color: #fff;
  font-size: 26px;
  margin: 0 0 8px;
  letter-spacing: 1px;
  font-weight: 700;
}

.auth-subtitle {
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}

/* Form Fields */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  width: 100%;
}

.form-field label {
  display: block;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrap {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  transition: border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
  min-height: 48px;
}

.input-wrap:focus-within {
  border-color: rgba(78,205,196,0.5);
  box-shadow: 0 0 12px rgba(0,212,255,0.1);
}

.input-icon {
  padding: 0 12px;
  font-size: 18px;
  flex-shrink: 0;
  opacity: 0.5;
}

.input-wrap input,
.input-wrap select {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 15px;
  padding: 13px 12px 13px 0;
  outline: none;
  min-width: 0;
  line-height: 1.4;
}

.input-wrap select {
  padding-left: 12px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23rgba(255,255,255,0.5)' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.input-wrap select option {
  background: #1a1a2e;
  color: #fff;
}

.input-wrap input::placeholder {
  color: rgba(255,255,255,0.25);
}

.input-wrap input::selection,
.input-wrap select::selection {
  background: rgba(78,205,196,0.3);
  color: #fff;
}

.toggle-pw {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 10px 12px;
  opacity: 0.5;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.toggle-pw:hover {
  opacity: 1;
}

.field-status {
  padding: 0 12px;
  font-size: 16px;
  flex-shrink: 0;
}

.field-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  margin-top: 6px;
  min-height: 16px;
  line-height: 1.4;
}

.field-hint.error {
  color: #e94560;
}

.field-hint.success {
  color: #4ecdc4;
  font-weight: 500;
}

/* Phone field - Enhanced */
.phone-wrap {
  gap: 0;
}

.country-code-select {
  flex: 0 0 auto !important;
  width: 110px !important;
  min-width: 110px !important;
  padding: 13px 8px !important;
  border-right: 1px solid rgba(255,255,255,0.08) !important;
  font-size: 14px !important;
  background: rgba(255,255,255,0.02) !important;
  font-weight: 500 !important;
}

.country-code-select option {
  padding: 8px;
}

/* Password strength - Enhanced */
.pw-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.pw-bar {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.pw-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.3s ease, background 0.3s ease;
}

.pw-label {
  font-size: 12px;
  font-weight: 600;
  min-width: 70px;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Captcha */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.captcha-question {
  flex: 1;
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: 10px;
  padding: 12px 16px;
  color: #FFD700;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.captcha-input-wrap {
  width: 110px;
  flex-shrink: 0;
}

.captcha-input-wrap input {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  padding: 12px !important;
}

.captcha-refresh {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  cursor: pointer;
  font-size: 20px;
  padding: 10px 12px;
  transition: background 0.2s;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
}

.captcha-refresh:hover {
  background: rgba(255,255,255,0.1);
}

/* Error */
.auth-error {
  background: rgba(233,69,96,0.1);
  border: 1px solid rgba(233,69,96,0.3);
  border-radius: 10px;
  padding: 12px 16px;
  color: #e94560;
  font-size: 14px;
  text-align: center;
  line-height: 1.5;
}

/* Submit - Enhanced */
.auth-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #00ffc8, #00aaff);
  border: none;
  border-radius: 12px;
  color: #0a0a1a;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
  min-height: 52px;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,212,255,0.3);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Footer */
.auth-footer {
  text-align: center;
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  margin-top: 8px;
  line-height: 1.8;
}

.auth-footer a {
  color: #4ecdc4;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.auth-footer a:hover {
  color: #00ffc8;
  text-decoration: underline;
}

/* v1.6.0: Auth page language selector */
.auth-language-selector {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
}

.auth-language-selector select {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(78,205,196,0.3);
  color: #ccc;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.auth-language-selector select:hover {
  border-color: rgba(78,205,196,0.6);
}

.auth-language-selector select option {
  background: #1a1a2e;
  color: #eee;
}

/* Responsive - Tablet */
@media (max-width: 768px) {
  .auth-page {
    padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  }

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

  .auth-header h1 {
    font-size: 24px;
  }

  .auth-header img {
    max-width: 180px;
  }

  .input-wrap input,
  .input-wrap select {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
}

/* Responsive - Mobile */
@media (max-width: 640px) {
  .auth-page {
    align-items: flex-start;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .auth-card {
    margin-top: 8px;
    border-radius: 14px;
    padding: 22px 18px;
  }

  .auth-header {
    margin-bottom: 24px;
  }

  .auth-header h1 {
    font-size: 22px;
  }

  .auth-header img {
    max-width: 160px;
    margin-bottom: 10px;
  }

  .auth-subtitle {
    font-size: 13px;
  }

  .form-field label {
    margin-bottom: 6px;
    font-size: 12px;
  }

  .input-wrap {
    min-height: 46px;
  }

  .input-wrap input,
  .input-wrap select {
    font-size: 16px; /* Prevents iOS zoom */
    padding: 12px 10px 12px 0;
  }

  .input-wrap select {
    padding-left: 10px;
    padding-right: 30px;
  }

  .input-icon {
    font-size: 16px;
    padding: 0 10px;
  }

  .country-code-select {
    width: 100px !important;
    min-width: 100px !important;
    padding: 12px 6px !important;
    font-size: 13px !important;
  }

  .toggle-pw {
    font-size: 15px;
    padding: 10px 10px;
  }

  .field-status {
    font-size: 15px;
  }

  .field-hint {
    font-size: 11px;
    margin-top: 5px;
    min-height: 15px;
  }

  .pw-strength {
    margin-top: 6px;
    gap: 8px;
  }

  .pw-bar {
    height: 4px;
  }

  .pw-label {
    font-size: 11px;
    min-width: 60px;
  }

  .captcha-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .captcha-question {
    min-width: 100%;
    min-height: 42px;
    font-size: 15px;
    padding: 10px 12px;
  }

  .captcha-input-wrap {
    flex: 1;
    width: auto;
  }

  .captcha-refresh {
    min-height: 42px;
    min-width: 42px;
  }

  .auth-submit {
    padding: 14px;
    font-size: 15px;
    min-height: 48px;
  }

  .auth-footer {
    font-size: 13px;
    margin-top: 6px;
  }
}

/* Responsive - Small Mobile */
@media (max-width: 420px) {
  .auth-page {
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .auth-card {
    padding: 20px 14px;
    border-radius: 12px;
  }

  .auth-language-selector {
    top: 10px;
    right: 10px;
  }

  .auth-language-selector select {
    font-size: 12px;
    padding: 5px 8px;
  }

  .auth-header {
    margin-bottom: 20px;
  }

  .auth-header h1 {
    font-size: 20px;
  }

  .auth-header img {
    max-width: 140px;
  }

  .auth-form {
    gap: 14px;
  }

  .input-wrap {
    min-height: 44px;
  }

  .country-code-select {
    width: 95px !important;
    min-width: 95px !important;
    padding: 11px 5px !important;
    font-size: 12px !important;
  }

  .auth-submit {
    padding: 13px;
    font-size: 14px;
    min-height: 46px;
  }
}

/* Responsive - Very Small Mobile */
@media (max-width: 360px) {
  .auth-card {
    padding: 18px 12px;
  }

  .country-code-select {
    width: 90px !important;
    min-width: 90px !important;
    font-size: 11px !important;
  }

  .auth-header h1 {
    font-size: 18px;
  }
}