/**
 * Beacon Tower Auth Page Styling
 *
 * Customizable standalone page for authentication flow.
 * Used throughout: pre-auth → B2C → post-redirect → app loading
 *
 * Customization: Edit CSS variables below or override in auth-config.js
 */

:root {
  /* Background */
  --auth-bg-color: #000000;
  --auth-bg-image: none; /* Set to url('/auth-branding/background.jpg') for custom image */

  /* Text */
  --auth-text-color: #ffffff;
  --auth-subtitle-color: #e0e0e0;
  --auth-status-color: #e0e0e0;

  /* Logo */
  --auth-logo-height: 80px;
  --auth-logo-max-width: 200px;

  /* Button */
  --auth-button-bg: #0066cc;
  --auth-button-bg-hover: #0052a3;
  --auth-button-text: #ffffff;
  --auth-button-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);

  /* Spinner */
  --auth-spinner-color: #ffffff;
  --auth-spinner-bg: rgba(255, 255, 255, 0.1);
  --auth-spinner-size: 50px;

  /* Spacing */
  --auth-title-size: 3rem;
  --auth-subtitle-size: 1.5rem;
  --auth-status-size: 1.125rem;

  /* Shadows */
  --auth-text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body */
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* ========================================
   ANIMATED BEACON BACKGROUND
   (Same as React AnimatedBeacon component)
   ======================================== */

.animated-beacon {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 0;
}

/* Ripple container with 3D perspective */
/* .animated-beacon__ripple-container {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 800px;
  transform-style: preserve-3d;
} */

/* Individual ripple rings */
/* .animated-beacon__ripple {
  position: absolute;
  border: 3px solid rgba(211, 47, 47, 0.6);
  border-radius: 50%;
  animation: ripple-animation 60s ease-out infinite;
  transform: rotateX(60deg);
  transform-style: preserve-3d;
} */

/* Ripple animation keyframes */
/* @keyframes ripple-animation {
  0% {
    width: 160px;
    height: 160px;
    opacity: 1;
    border-width: 3px;
  }
  50% {
    opacity: 0.6;
    border-width: 2px;
  }
  100% {
    width: 800px;
    height: 800px;
    opacity: 0;
    border-width: 1px;
  }
} */

/* Central beacon logo */
.animated-beacon__logo {
  position: relative;
  width: 220px;
  height: 300px;
  z-index: 10;
  filter: drop-shadow(0 0 20px rgba(211, 47, 47, 0.5));
  animation: float 10s ease-in-out infinite;
  transform: translate(0px, -100px);
}

/* Float animation for logo */
@keyframes float {
  0%, 100% {
    transform: translate(0px, -100px) translateY(0px) scale(1);
  }
  50% {
    transform: translate(0px, -100px) translateY(-10px) scale(1.05);
  }
}

/* Logo image */
.animated-beacon__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Container - Overlay on top of AnimatedBeacon */
.auth-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  z-index: 1;
  pointer-events: none; /* Allow clicks to pass through to AnimatedBeacon */
}

.auth-container > * {
  pointer-events: auto; /* Re-enable clicks on child elements */
}

/* Logo */
.auth-logo {
  margin-bottom: 2rem;
}

.auth-logo img {
  height: var(--auth-logo-height);
  max-width: var(--auth-logo-max-width);
  object-fit: contain;
}

/* Title */
.auth-title {
  color: var(--auth-text-color);
  font-size: var(--auth-title-size);
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: var(--auth-text-shadow);
}

.auth-subtitle {
  color: var(--auth-subtitle-color);
  font-size: var(--auth-subtitle-size);
  margin-bottom: 3rem;
  text-shadow: var(--auth-text-shadow);
}

/* Button Mode */
.auth-actions {
  display: none; /* Controlled by JavaScript */
}

.auth-button {
  font-size: 1.125rem;
  padding: 1rem 3rem;
  min-width: 200px;
  background: var(--auth-button-bg);
  color: var(--auth-button-text);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--auth-button-shadow);
  transition: all 0.2s ease;
}

.auth-button:hover {
  background: var(--auth-button-bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.auth-button:active {
  transform: translateY(0);
}

/* Loading Mode */
.auth-loading {
  display: none; /* Controlled by JavaScript */
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Spinner */
.spinner {
  border: 4px solid var(--auth-spinner-bg);
  border-top: 4px solid var(--auth-spinner-color);
  border-radius: 50%;
  width: var(--auth-spinner-size);
  height: var(--auth-spinner-size);
  animation: spin 1s linear infinite;
}

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

/* Status Text */
.auth-status {
  color: var(--auth-status-color);
  font-size: var(--auth-status-size);
  margin: 0;
  text-shadow: var(--auth-text-shadow);
}

/* B2C Container */
#api {
  width: 100%;
  max-width: 500px;
  margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
  .auth-title {
    font-size: 2rem;
  }

  .auth-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
  }

  .auth-button {
    font-size: 1rem;
    padding: 0.875rem 2rem;
    min-width: 160px;
  }

  .auth-status {
    font-size: 1rem;
  }
}

/* Print (hide spinner) */
@media print {
  .spinner {
    display: none;
  }
}
