/* =============================================
   Auth UI Components - The Dark Sovereign
   Design System: Gothic panels, Press Start 2P font,
   Gold accent (#c4a04a), stone backgrounds
   ============================================= */

/* ------ Shared Modal Overlay ------ */
.auth-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.auth-overlay.show {
  display: flex;
}

/* ------ Gothic Auth Panel ------ */
.auth-panel {
  background: #0a0000;
  border: 1px solid rgba(196, 160, 74, 0.4);
  padding: 32px 28px;
  width: 100%;
  max-width: 400px;
  position: relative;
  animation: authPanelIn 0.3s ease-out;
}

/* Accent stripe (left edge brass trim) */
.auth-panel::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 1px;
  width: 3px;
  height: calc(100% - 2px);
  background: rgba(196, 160, 74, 0.6);
}

@keyframes authPanelIn {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ------ Panel Header ------ */
.auth-panel-header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}

.auth-panel-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  color: #c4a04a;
  font-weight: 400;
  letter-spacing: 0px;
  margin-bottom: 8px;
}

.auth-panel-subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #6a5a3a;
  line-height: 1.6;
}

/* ------ Close Button ------ */
.auth-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: 1px solid rgba(196, 160, 74, 0.3);
  color: #6a5a3a;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease-out;
  line-height: 1;
}

.auth-close-btn:hover {
  color: #c4a04a;
  border-color: rgba(196, 160, 74, 0.6);
}

/* ------ Form Group ------ */
.auth-form-group {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #6a5a3a;
  margin-bottom: 8px;
  letter-spacing: 0px;
  text-transform: uppercase;
}

/* ------ Input Fields ------ */
.auth-input {
  width: 100%;
  padding: 10px 12px;
  background: #080605;
  border: 1px solid rgba(196, 160, 74, 0.4);
  color: #c4a04a;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  outline: none;
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}

.auth-input::placeholder {
  color: #3a3025;
  font-style: italic;
}

.auth-input:focus {
  border-color: #c4a04a;
  box-shadow: 0 0 8px rgba(196, 160, 74, 0.15);
}

/* Error state */
.auth-input.error {
  border-color: #ff4444;
  box-shadow: 0 0 6px rgba(255, 68, 68, 0.15);
}

/* Autofill override */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #c4a04a;
  -webkit-box-shadow: 0 0 0px 1000px #080605 inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* ------ Password wrapper with toggle ------ */
.auth-password-wrapper {
  position: relative;
}

.auth-password-wrapper .auth-input {
  padding-right: 40px;
}

.auth-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6a5a3a;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s ease-out;
}

.auth-password-toggle:hover {
  color: #c4a04a;
}

/* ------ Field Error Message ------ */
.auth-field-error {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #ff4444;
  margin-top: 4px;
  min-height: 14px;
  line-height: 1.4;
}

/* ------ Submit Button ------ */
.auth-submit-btn {
  width: 100%;
  padding: 12px 16px;
  background: #c4a04a;
  color: #000;
  border: 2px solid #000;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  font-weight: 400;
  cursor: pointer;
  letter-spacing: 0px;
  text-transform: uppercase;
  transition: all 0.15s ease-out;
  box-shadow: 0 0 8px rgba(196, 160, 74, 0.15);
  margin-top: 8px;
}

.auth-submit-btn:hover:not(:disabled) {
  background: #ffdd88;
  box-shadow: 0 0 14px rgba(196, 160, 74, 0.3);
}

.auth-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #1a1510;
  color: #6a5a3a;
  border-color: #3a3025;
  box-shadow: none;
}

/* ------ Form-Level Messages ------ */
.auth-message {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  line-height: 1.6;
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid;
  display: none;
}

.auth-message.show {
  display: block;
}

.auth-message.error {
  color: #ff4444;
  border-color: rgba(255, 68, 68, 0.4);
  background: rgba(139, 26, 26, 0.15);
}

.auth-message.success {
  color: #88ff88;
  border-color: rgba(136, 255, 136, 0.4);
  background: rgba(26, 139, 26, 0.15);
}

.auth-message.info {
  color: #7799dd;
  border-color: rgba(119, 153, 221, 0.4);
  background: rgba(26, 40, 80, 0.15);
}

/* ------ Panel Footer Links ------ */
.auth-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(196, 160, 74, 0.15);
}

.auth-link {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #6a5a3a;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease-out;
  padding: 0;
}

.auth-link:hover {
  color: #c4a04a;
}

.auth-footer-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #3a3025;
  margin-bottom: 8px;
}

.auth-divider {
  color: #3a3025;
  margin: 0 8px;
}

/* ------ Loading Spinner ------ */
.auth-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #000;
  border-top-color: transparent;
  border-radius: 50%;
  animation: authSpin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

/* ------ Password Strength Indicator ------ */
.auth-password-strength {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.auth-strength-bar {
  flex: 1;
  height: 3px;
  background: rgba(196, 160, 74, 0.15);
  transition: background 0.15s ease-out;
}

.auth-strength-bar.active.weak {
  background: #ff4444;
}

.auth-strength-bar.active.medium {
  background: #c4a04a;
}

.auth-strength-bar.active.strong {
  background: #88ff88;
}

.auth-strength-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  margin-top: 2px;
  transition: color 0.15s ease-out;
}

.auth-strength-label.weak { color: #ff4444; }
.auth-strength-label.medium { color: #c4a04a; }
.auth-strength-label.strong { color: #88ff88; }

/* =============================================
   Standalone Auth Pages (Reset Password, Verify)
   ============================================= */

.auth-page {
  min-height: 100vh;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  font-family: 'Press Start 2P', monospace;
}

.auth-page-panel {
  background: #0a0000;
  border: 1px solid rgba(196, 160, 74, 0.4);
  padding: 40px 32px;
  width: 100%;
  max-width: 440px;
  position: relative;
}

/* Accent stripe */
.auth-page-panel::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 1px;
  width: 3px;
  height: calc(100% - 2px);
  background: rgba(196, 160, 74, 0.6);
}

.auth-page-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  color: #c4a04a;
  text-align: center;
  margin-bottom: 8px;
  font-weight: 400;
}

.auth-page-subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #6a5a3a;
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.6;
}

.auth-page-home-link {
  display: block;
  text-align: center;
  margin-top: 24px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #6a5a3a;
  text-decoration: none;
  transition: color 0.15s ease-out;
}

.auth-page-home-link:hover {
  color: #c4a04a;
}

/* Status icon for verify/result pages */
.auth-status-icon {
  text-align: center;
  font-size: 48px;
  margin-bottom: 16px;
  line-height: 1;
}

.auth-status-icon.success { color: #88ff88; }
.auth-status-icon.error { color: #ff4444; }
.auth-status-icon.loading { color: #7799dd; }

/* ------ Responsive ------ */
@media (max-width: 480px) {
  .auth-panel {
    padding: 24px 20px;
    max-width: 100%;
  }

  .auth-panel-title {
    font-size: 14px;
  }

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

  .auth-page-title {
    font-size: 14px;
  }
}
