* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: #000;
  color: #fff;
  font-family: 'Cairo', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-x: hidden;
  position: relative;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(249, 115, 22, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(249, 115, 22, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(249, 115, 22, 0.03) 0%, transparent 60%);
  pointer-events: none;
  animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* Main container */
.auth-container {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(10, 12, 18, 0.98));
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 1.25rem;
  padding: 1.5rem 1.75rem;
  box-shadow:
    0 0 100px rgba(249, 115, 22, 0.15),
    0 25px 80px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  animation: containerAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: transform 0.5s ease;
}

.auth-container.shifted {
  transform: translateX(-200px);
}

.auth-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.3), transparent 30%, transparent 70%, rgba(249, 115, 22, 0.3));
  border-radius: 1.25rem;
  z-index: -1;
  opacity: 0.4;
  animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {

  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes containerAppear {
  from {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Logo */
.auth-logo {
  text-align: center;
  margin-bottom: 1rem;
}

.auth-logo h1 {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 0.15rem;
}

.auth-logo span {
  color: #f97316;
}

.auth-logo p {
  font-size: 0.8rem;
  color: #9ca3af;
  font-weight: 400;
}

/* Tab navigation */
.auth-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.35rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(249, 115, 22, 0.1);
}

.auth-tab {
  flex: 1;
  padding: 0.5rem 0.65rem;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-family: 'Cairo', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 0.45rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.auth-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(249, 115, 22, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-tab:hover {
  color: #fff;
}

.auth-tab:hover::before {
  opacity: 0.5;
}

.auth-tab.active {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
}

.auth-tab.active::before {
  opacity: 0;
}

/* Forms */
.auth-form {
  display: none;
  animation: formFadeIn 0.4s ease forwards;
}

.auth-form.active {
  display: block;
}

@keyframes formFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-group {
  margin-bottom: 0.75rem;
}

.form-label {
  display: block;
  margin-bottom: 0.3rem;
  color: #9ca3af;
  font-size: 0.8rem;
  font-weight: 600;
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 0.55rem;
  color: #fff;
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  outline: none;
}

.form-input::placeholder {
  color: #6b7280;
}

.form-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
  background: rgba(0, 0, 0, 0.6);
}

/* Secret phrases display */
.secret-phrases-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9998;
  padding: 1rem;
}

.secret-phrases-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.secret-phrases {
  width: min(92vw, 420px);
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.98), rgba(10, 12, 18, 0.99));
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 1.25rem;
  padding: 1.1rem;
  box-shadow:
    0 0 100px rgba(249, 115, 22, 0.15),
    0 25px 80px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.secret-phrases-overlay.open .secret-phrases {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.secret-phrases-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.secret-phrases-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f97316;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.secret-phrases-title::before {
  content: '🔐';
  font-size: 1rem;
}

.secret-phrases-timer {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fbbf24;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.secret-phrases-note {
  font-size: 0.75rem;
  color: #cbd5f5;
  margin-bottom: 0.7rem;
  line-height: 1.4;
}

.secret-phrase-item {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 0.5rem;
  padding: 0.55rem;
  margin-bottom: 0.6rem;
  position: relative;
}

.secret-phrase-item:last-child {
  margin-bottom: 0;
}

.secret-phrase-label {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.secret-phrase-value {
  font-family: 'Courier New', monospace;
  font-size: 0.68rem;
  color: #f97316;
  word-break: break-all;
  line-height: 1.35;
  user-select: all;
  padding-right: 2.5rem;
}

.copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  background: rgba(249, 115, 22, 0.2);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: #f97316;
  width: 28px;
  height: 28px;
  border-radius: 0.45rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Cairo', sans-serif;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.copy-btn:hover {
  background: rgba(249, 115, 22, 0.4);
  transform: scale(1.05);
}

.copy-btn.copied {
  background: rgba(34, 197, 94, 0.3);
  border-color: rgba(34, 197, 94, 0.5);
  color: #22c55e;
}

.copy-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.btn-remember {
  margin-top: 0.4rem;
}

/* Success notification */
.success-notification {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.95));
  border: 1px solid rgba(34, 197, 94, 0.5);
  border-radius: 1rem;
  padding: 1rem 2rem;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 10px 40px rgba(34, 197, 94, 0.3);
  z-index: 10000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-notification.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 0.7rem;
  background: linear-gradient(135deg, #f97316, #ea580c);
  border: none;
  border-radius: 0.55rem;
  color: #fff;
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(249, 115, 22, 0.5);
}

.btn:hover::before {
  opacity: 1;
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
  box-shadow: none;
  margin-top: 0.6rem;
}

.btn-secondary:hover {
  background: rgba(249, 115, 22, 0.2);
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.2);
}

/* Anonymous login */
.anonymous-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(249, 115, 22, 0.2);
  text-align: center;
}

.anonymous-text {
  font-size: 1rem;
  color: #9ca3af;
  margin-bottom: 0.6rem;
}

/* Recovery link */
.recovery-link {
  display: block;
  text-align: center;
  margin-top: 0.6rem;
  color: #f97316;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.recovery-link:hover {
  color: #ea580c;
  text-decoration: underline;
}

/* Success message */
.success-message {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 0.55rem;
  padding: 0.7rem;
  margin-bottom: 0.75rem;
  color: #22c55e;
  font-size: 0.8rem;
  text-align: center;
  display: none;
}

.success-message.visible {
  display: block;
  animation: formFadeIn 0.4s ease forwards;
}

/* Error message */
.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 0.55rem;
  padding: 0.7rem;
  margin-bottom: 0.75rem;
  color: #ef4444;
  font-size: 0.8rem;
  text-align: center;
  display: none;
}

.error-message.visible {
  display: block;
  animation: formFadeIn 0.4s ease forwards;
}

/* Phrase selector */
.phrase-selector {
  background: rgba(249, 115, 22, 0.05);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 0.55rem;
  padding: 0.7rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.phrase-selector-label {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.phrase-number {
  font-size: 1rem;
  color: #f97316;
  font-weight: 700;
}

/* Responsive */
@media (max-width: 640px) {
  body {
    padding: 0.5rem;
  }

  .auth-container {
    padding: 1.25rem 1rem;
  }

  .auth-container.shifted {
    transform: translateX(0);
  }

  .auth-logo h1 {
    font-size: 1.35rem;
  }

  .auth-tabs {
    flex-direction: column;
  }

  .secret-phrase-value {
    font-size: 0.6rem;
  }
}

.password-requirements,
.form-hint {
  display: none;

}

/* Agreement checkbox */
.agreement-checkbox-group {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(249, 115, 22, 0.05);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 0.55rem;
}

.agreement-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: #d1d5db;
  line-height: 1.4;
}

.agreement-checkbox {
  display: none;
}

.checkbox-custom {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(249, 115, 22, 0.4);
  border-radius: 0.25rem;
  background: rgba(0, 0, 0, 0.4);
  position: relative;
  transition: all 0.3s ease;
}

.checkbox-custom::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  transition: transform 0.2s ease;
}

.agreement-checkbox:checked+.checkbox-custom {
  background: linear-gradient(135deg, #f97316, #ea580c);
  border-color: #f97316;
}

.agreement-checkbox:checked+.checkbox-custom::after {
  transform: translate(-50%, -50%) scale(1);
}

.agreement-checkbox-label:hover .checkbox-custom {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.1);
}

.agreement-link {
  color: #f97316;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.agreement-link:hover {
  color: #fb923c;
  text-decoration: underline;
}

/* Disabled button state */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn:disabled:hover {
  transform: none !important;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3) !important;
}

/* ===== User Agreement Overlay ===== */

/* ==== User Agreement Overlay ==== */

.agreement-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.agreement-overlay.open {
  display: flex;
}

.agreement-overlay-backdrop {
  position: absolute;
  inset: 0;
}

/* MAKE THE WINDOW LARGER HERE */
.agreement-overlay-content {
  position: relative;
  width: 95vw;
  /* almost full screen width */
  max-width: 1280px;
  /* but no more than 1280px */
  height: 90vh;
  /* 80% of screen height */
  max-height: 90vh;
  /* max 90% height */
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(249, 115, 22, 0.6);
  background: #020617;
}

.agreement-iframe {
  width: 100%;
  height: 100%;
  /* iframe stretches to full window height */
  border: none;
}
