/**
 * CoinRush Auth Modal - Shared CSS
 * Premium authentication modal styling for all pages
 */

/* ============================================
   AUTH MODAL - Premium Design
   ============================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: authFadeIn 0.25s ease-out;
}

@keyframes authFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-modal {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(165deg, #181d28 0%, #10131a 50%, #0c0f14 100%);
  border-radius: 20px;
  border: 1px solid rgba(79, 255, 176, 0.15);
  padding: 24px;
  box-shadow: 
    0 32px 100px rgba(0, 0, 0, 0.7),
    0 0 80px rgba(79, 255, 176, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  animation: authSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authSlideIn {
  from {
    opacity: 0;
    transform: translateY(-24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Decorative Glow Effects */
.auth-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
}

.auth-glow-1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #4fffb0 0%, transparent 70%);
  top: -150px;
  right: -100px;
}

.auth-glow-2 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, #a855f7 0%, transparent 70%);
  bottom: -100px;
  left: -80px;
  opacity: 0.3;
}

.auth-border-glow {
  position: absolute;
  inset: -1px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(79, 255, 176, 0.3) 0%, transparent 40%, transparent 60%, rgba(168, 85, 247, 0.2) 100%);
  z-index: -1;
  opacity: 0.5;
}

/* Close Button */
.auth-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #6e7681;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.auth-close svg {
  width: 18px;
  height: 18px;
}

.auth-close:hover {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.4);
  color: #ff6b6b;
  transform: rotate(90deg);
}

/* Brand/Logo Section */
.auth-brand {
  text-align: center;
  margin-bottom: 16px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4fffb0 0%, #3de8a0 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(79, 255, 176, 0.3);
}

.auth-logo-icon span {
  font-size: 15px;
  font-weight: 900;
  color: #0a0d12;
  letter-spacing: -0.5px;
}

.auth-logo-text-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.auth-logo-title {
  font-size: 17px;
  font-weight: 800;
  color: #f0f6fc;
  letter-spacing: 1px;
}

.auth-logo-subtitle {
  font-size: 9px;
  font-weight: 600;
  color: #4fffb0;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Mode Tabs */
.auth-tabs {
  display: flex;
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-tab {
  flex: 1;
  padding: 10px 16px;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: #6e7681;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}

.auth-tab:hover:not(.active) {
  color: #b1bac4;
}

.auth-tab.active {
  color: #0a0d12;
}

.auth-tab-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: linear-gradient(135deg, #4fffb0 0%, #3de8a0 100%);
  border-radius: 8px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(79, 255, 176, 0.3);
}

.auth-tab-indicator.right {
  transform: translateX(100%);
}

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

/* Messages */
.auth-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  animation: authShake 0.4s ease-out;
}

.auth-message svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-message-error {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.25);
  color: #ff6b6b;
}

.auth-message-success {
  background: rgba(79, 255, 176, 0.1);
  border: 1px solid rgba(79, 255, 176, 0.25);
  color: #4fffb0;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

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

.auth-label {
  font-size: 11px;
  font-weight: 600;
  color: #b1bac4;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-input-box {
  position: relative;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  padding-right: 44px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #f0f6fc;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.auth-input:focus {
  outline: none;
  border-color: #4fffb0;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 4px rgba(79, 255, 176, 0.1);
}

.auth-input::placeholder {
  color: #6e7681;
  font-weight: 400;
}

/* Password Toggle */
.auth-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: #6e7681;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.auth-eye svg {
  width: 20px;
  height: 20px;
}

.auth-eye:hover {
  color: #f0f6fc;
  background: rgba(255, 255, 255, 0.05);
}

/* Forgot Password */
.auth-forgot {
  text-align: right;
  margin-top: -6px;
}

.auth-forgot-link {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: #6e7681;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.auth-forgot-link:hover {
  color: #4fffb0;
}

/* Submit Button */
.auth-submit {
  width: 100%;
  padding: 12px 20px;
  margin-top: 4px;
  background: linear-gradient(135deg, #4fffb0 0%, #2ea77a 100%);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #0a0d12;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(79, 255, 176, 0.25);
}

.auth-submit svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(79, 255, 176, 0.4);
}

.auth-submit:hover svg {
  transform: translateX(4px);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.auth-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(10, 13, 18, 0.25);
  border-top-color: #0a0d12;
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
}

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

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.auth-divider span {
  font-size: 10px;
  font-weight: 500;
  color: #6e7681;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   OAuth Full-Width Branded Buttons
   ============================================ */
.auth-oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-oauth-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.auth-oauth-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s;
}

.auth-oauth-btn:hover::before {
  opacity: 1;
}

.auth-oauth-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-oauth-icon svg {
  width: 16px;
  height: 16px;
}

.auth-oauth-text {
  flex: 1;
  text-align: center;
  margin: 0 8px;
}

.auth-oauth-arrow {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  flex-shrink: 0;
  transition: all 0.25s;
}

.auth-oauth-btn:hover .auth-oauth-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* Discord OAuth Button */
.auth-oauth-discord {
  background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

.auth-oauth-discord::before {
  background: linear-gradient(135deg, #6B75F5 0%, #5865F2 100%);
}

.auth-oauth-discord:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(88, 101, 242, 0.45);
}

/* Google OAuth Button */
.auth-oauth-google {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  color: #3c4043;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.auth-oauth-google::before {
  background: linear-gradient(135deg, #ffffff 0%, #f1f3f4 100%);
}

.auth-oauth-google:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.auth-oauth-google .auth-oauth-arrow {
  color: #5f6368;
}

/* X (Twitter) OAuth Button */
.auth-oauth-twitter {
  background: linear-gradient(135deg, #14171A 0%, #000000 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.auth-oauth-twitter::before {
  background: linear-gradient(135deg, #2a2e33 0%, #14171A 100%);
}

.auth-oauth-twitter:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

/* Disabled state */
.auth-oauth-btn:disabled,
.auth-oauth-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.auth-oauth-btn:disabled:hover::before,
.auth-oauth-btn.disabled:hover::before {
  opacity: 0;
}

/* Footer */
.auth-footer {
  margin-top: 24px;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-footer p {
  margin: 0;
  font-size: 14px;
  color: #6e7681;
}

.auth-switch {
  background: none;
  border: none;
  color: #4fffb0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.auth-switch:hover {
  text-decoration: underline;
  text-shadow: 0 0 12px rgba(79, 255, 176, 0.5);
}

/* Responsive */
@media (max-width: 480px) {
  .auth-modal {
    padding: 28px 24px;
    border-radius: 20px;
  }
  
  .auth-tabs {
    margin-bottom: 24px;
  }
  
  .auth-oauth-buttons {
    gap: 8px;
  }
  
  .auth-oauth-btn {
    padding: 12px 14px;
    font-size: 13px;
  }
}

/* Footer */
.auth-footer {
  margin-top: 12px;
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-footer p {
  margin: 0;
  font-size: 12px;
  color: #6e7681;
}

.auth-switch {
  background: none;
  border: none;
  color: #4fffb0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.auth-switch:hover {
  text-decoration: underline;
  text-shadow: 0 0 12px rgba(79, 255, 176, 0.5);
}

/* Responsive */
@media (max-width: 480px) {
  .auth-modal {
    padding: 28px 24px;
    border-radius: 20px;
  }
  
  .auth-tabs {
    margin-bottom: 24px;
  }
  
  .auth-social {
    flex-direction: column;
  }
}

/* ============================================
   AGE VERIFICATION CHECKBOX
   ============================================ */
.auth-age-verify {
  margin: 16px 0 20px;
}

.auth-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.auth-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.auth-checkbox-custom {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-top: 1px;
}

.auth-checkbox-custom svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
  stroke: #0d1117;
}


.auth-checkbox:checked + .auth-checkbox-custom {
  background: linear-gradient(135deg, #4fffb0, #3de896);
  border-color: #4fffb0;
  box-shadow: 
    0 0 16px rgba(79, 255, 176, 0.4),
    0 4px 12px rgba(79, 255, 176, 0.2);
}

.auth-checkbox:checked + .auth-checkbox-custom svg {
  opacity: 1;
  transform: scale(1);
}

.auth-checkbox:focus + .auth-checkbox-custom {
  border-color: #4fffb0;
  box-shadow: 0 0 0 3px rgba(79, 255, 176, 0.15);
}

.auth-checkbox-label:hover .auth-checkbox-custom {
  border-color: rgba(79, 255, 176, 0.4);
  background: rgba(79, 255, 176, 0.05);
}

.auth-checkbox-text {
  font-size: 13px;
  color: #8b949e;
  line-height: 1.5;
}

.auth-checkbox-text strong {
  color: #c9d1d9;
  font-weight: 600;
}

.auth-checkbox-text a {
  color: #4fffb0;
  text-decoration: none;
  transition: all 0.2s;
}

.auth-checkbox-text a:hover {
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(79, 255, 176, 0.4);
}

/* Disabled submit when age not verified */
.auth-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.auth-submit:disabled:hover {
  box-shadow: none;
}

/* ============================================
   AGE VERIFICATION BUTTON & POPUP
   ============================================ */

/* Age Verification Button */
.auth-age-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #8b949e;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-age-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
  color: #c9d1d9;
}

.auth-age-btn svg {
  width: 14px;
  height: 14px;
}

.auth-age-btn.verified {
  background: rgba(79, 255, 176, 0.08);
  border: 1px solid rgba(79, 255, 176, 0.3);
  color: #4fffb0;
}

.auth-age-btn.verified:hover {
  background: rgba(79, 255, 176, 0.12);
}

/* Age Popup Overlay */
.age-popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 24px;
}

/* Age Popup */
.age-popup {
  background: #161b22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 90%;
  max-width: 320px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.age-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.age-popup-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.age-popup-close {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #6e7681;
  transition: color 0.2s;
}

.age-popup-close:hover {
  color: #fff;
}

.age-popup-close svg {
  width: 20px;
  height: 20px;
}

.age-popup-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.age-popup-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.age-popup-field label {
  font-size: 12px;
  font-weight: 500;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.age-popup-field input,
.age-popup-field select {
  width: 100%;
  padding: 12px 14px;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #c9d1d9;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.age-popup-field input:focus,
.age-popup-field select:focus {
  border-color: #4fffb0;
}

.age-popup-field input[type="date"] {
  color-scheme: dark;
}

.age-popup-field select {
  appearance: none;
  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='%236e7681' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.age-popup-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  margin-top: 4px;
}

.age-popup-terms input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #4fffb0;
  cursor: pointer;
  flex-shrink: 0;
}

.age-popup-terms span {
  font-size: 13px;
  color: #8b949e;
  line-height: 1.4;
}

.age-popup-terms a {
  color: #4fffb0;
  text-decoration: none;
}

.age-popup-terms a:hover {
  text-decoration: underline;
}

.age-popup-confirm {
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  background: linear-gradient(135deg, #4fffb0, #2dd4bf);
  border: none;
  border-radius: 10px;
  color: #0d1117;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.age-popup-confirm:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(79, 255, 176, 0.3);
}

.age-popup-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Select/Dropdown Styling */
.auth-select {
  appearance: none;
  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='%236e7681' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
  cursor: pointer;
}

.auth-select:focus {
  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='%234fffb0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.auth-select option {
  background: #0d1117;
  color: #c9d1d9;
}
