/**
 * Landing Page Styles
 * Handles the 3-phase flow: Welcome -> Name Entry -> Room Code
 * 
 * Updated: Recessed card design from mockup-recessed-v2.html
 */

:root {
  --accent-primary: #5bc0be;
  --accent-secondary: #47a2a0;
  --accent-tertiary: #3d8b89;
  --accent-danger: #e74c3c;
  --accent-warning: #f39c12;
  --bg-primary: #0a0e14;
  --bg-secondary: #131920;
  --bg-tertiary: #1a222c;
  --text-primary: #e8edf3;
  --text-secondary: #8b95a5;
  --border-color: rgba(91, 192, 190, 0.2);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --transition-fast: 0.2s ease;
}

/* ==========================================
   LANDING PAGE CONTAINER
   ========================================== */
.encryption-notice {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.encryption-notice[data-mode="decentralized"] {
  color: #91e6ac;
  border-color: #488b5c;
  background: rgba(52, 130, 76, 0.12);
}

.encryption-notice[data-mode="server"] {
  color: #ffd18a;
  border-color: #9b742e;
  background: rgba(170, 115, 24, 0.12);
}

.landing-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* Atmospheric background */
.landing-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 800px 600px at 15% 25%, rgba(91, 192, 190, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 700px 700px at 85% 75%, rgba(71, 162, 160, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 400px 300px at 50% 50%, rgba(91, 192, 190, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================
   RECESSED CARD
   ========================================== */
.recessed-card {
  width: 100%;
  max-width: 480px;
  padding: 56px 48px;
  background: var(--bg-secondary);
  border-radius: 28px;
  position: relative;
  overflow: hidden;
  /* Recessed effect: inset shadows create depth */
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.03),
    inset 0 -2px 6px rgba(0, 0, 0, 0.3),
    inset 2px 0 4px rgba(255, 255, 255, 0.015),
    inset -2px 0 4px rgba(255, 255, 255, 0.015),
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 8px 24px rgba(0, 0, 0, 0.3);
  animation: cardReveal 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  opacity: 0;
  transform: scale(0.97);
}

/* Subtle light rim on top inner edge */
.recessed-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.06) 20%, 
    rgba(255, 255, 255, 0.08) 50%, 
    rgba(255, 255, 255, 0.06) 80%, 
    transparent 100%
  );
  pointer-events: none;
}

/* Subtle dark bottom inner edge */
.recessed-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(0, 0, 0, 0.15) 20%, 
    rgba(0, 0, 0, 0.2) 50%, 
    rgba(0, 0, 0, 0.15) 80%, 
    transparent 100%
  );
  pointer-events: none;
}

@keyframes cardReveal {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mouse-following subtle highlight */
.card-highlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
    rgba(91, 192, 190, 0.08) 0%, 
    transparent 60%
  );
}

.recessed-card:hover .card-highlight {
  opacity: 1;
}

/* Legacy class alias for backward compatibility */
/* Both .recessed-card and .landing-panel target the same styles */
.landing-panel {
  width: 100%;
  max-width: 480px;
  padding: 56px 48px;
  background: var(--bg-secondary);
  border-radius: 28px;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.03),
    inset 0 -2px 6px rgba(0, 0, 0, 0.3),
    inset 2px 0 4px rgba(255, 255, 255, 0.015),
    inset -2px 0 4px rgba(255, 255, 255, 0.015),
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 8px 24px rgba(0, 0, 0, 0.3);
  animation: cardReveal 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  opacity: 0;
  transform: scale(0.97);
}

.landing-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.06) 20%, 
    rgba(255, 255, 255, 0.08) 50%, 
    rgba(255, 255, 255, 0.06) 80%, 
    transparent 100%
  );
  pointer-events: none;
}

.landing-panel::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(0, 0, 0, 0.15) 20%, 
    rgba(0, 0, 0, 0.2) 50%, 
    rgba(0, 0, 0, 0.15) 80%, 
    transparent 100%
  );
  pointer-events: none;
}

/* ==========================================
   BRAND
   ========================================== */
.brand-container {
  text-align: center;
  margin-bottom: 40px;
}

/* Logo and branding */
.brand-logo {
  width: 68px;
  height: 68px;
  margin: 0 auto 22px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  /* Clean, minimal shadow - no glow */
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

.brand-logo::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
}

.brand-logo:hover {
  transform: scale(1.03);
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.brand-logo svg {
  width: 38px;
  height: 38px;
  fill: #fff;
  position: relative;
  z-index: 1;
}

.brand-title {
  font-size: 34px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.2px;
  line-height: 1.5;
}

/* ==========================================
   PHASE CONTAINERS
   ========================================== */
.phase-container {
  display: none;
  flex-direction: column;
  width: 100%;
  animation: phaseFadeIn 0.4s ease forwards;
}

.phase-container.active {
  display: flex;
}

@keyframes phaseFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Phase title */
.phase-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  margin: 0 0 8px;
}

.phase-hint {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin: 0 0 24px;
}

/* ==========================================
   FORM ELEMENTS
   ========================================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(91, 192, 190, 0.15);
}

.form-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

/* Checkbox styling */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
}

.checkbox-input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.checkbox-label {
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  flex: 1;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  box-shadow: 0 4px 16px rgba(91, 192, 190, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(91, 192, 190, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.btn-icon {
  font-size: 16px;
  line-height: 1;
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================
   WELCOME ACTIONS
   ========================================== */
.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.action-btn {
  padding: 17px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
  max-width: none;
  min-height: auto;
}

.primary-action {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  box-shadow: 
    0 3px 12px rgba(91, 192, 190, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

.primary-action::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.primary-action::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.primary-action:hover::before {
  opacity: 1;
}

.primary-action:hover::after {
  width: 350px;
  height: 350px;
}

.primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 5px 20px rgba(91, 192, 190, 0.25),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.primary-action:active {
  transform: translateY(0);
}

.secondary-action {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  border: 1px solid rgba(91, 192, 190, 0.15);
  box-shadow: 
    inset 0 1px 2px rgba(0, 0, 0, 0.2),
    0 1px 4px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.secondary-action::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(91, 192, 190, 0.06) 0%, rgba(91, 192, 190, 0.02) 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.secondary-action::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 16px rgba(91, 192, 190, 0);
  transition: box-shadow 0.35s ease;
}

.secondary-action:hover::before {
  opacity: 1;
}

.secondary-action:hover::after {
  box-shadow: inset 0 0 16px rgba(91, 192, 190, 0.06);
}

.secondary-action:hover {
  transform: translateY(-2px);
  border-color: rgba(91, 192, 190, 0.3);
  box-shadow: 
    inset 0 1px 2px rgba(0, 0, 0, 0.2),
    0 3px 12px rgba(91, 192, 190, 0.1),
    inset 0 0 16px rgba(91, 192, 190, 0.06);
  color: #7dd4d2;
}

/* ==========================================
   FEATURES
   ========================================== */
.features-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 20px;
  border-top: 1px solid rgba(91, 192, 190, 0.08);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.25s ease;
  padding: 10px 14px;
  border-radius: 10px;
}

.feature-item:hover {
  color: var(--text-primary);
  background: rgba(91, 192, 190, 0.04);
}

.feature-icon {
  width: 30px;
  height: 30px;
  background: rgba(91, 192, 190, 0.06);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.feature-item:hover .feature-icon {
  background: rgba(91, 192, 190, 0.1);
}

.feature-icon svg {
  width: 15px;
  height: 15px;
  stroke: var(--accent-primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================
   AUTO-JOIN INFO BOX
   ========================================== */
.auto-join-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  margin-bottom: 16px;
  background: rgba(91, 192, 190, 0.06);
  border: 1px solid rgba(91, 192, 190, 0.25);
  border-radius: 12px;
  animation: phaseFadeIn 0.4s ease forwards;
}

.auto-join-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.auto-join-content {
  flex: 1;
  min-width: 0;
}

.auto-join-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.auto-join-room-code {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.room-code-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.room-code-value {
  font-family: 'Outfit', monospace;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 1.5px;
  flex: 1;
  user-select: all;
}

.btn-copy-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  flex-shrink: 0;
}

.auto-join-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================
    RESPONSIVE
    ========================================== */
@media (max-width: 600px) {
  .recessed-card,
  .landing-panel {
    padding: 40px 28px;
    border-radius: 24px;
    margin: 16px;
  }

  .welcome-actions {
    gap: 10px;
  }

  .action-btn {
    padding: 15px 22px;
  }

  .btn-group {
    flex-direction: column;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
  }

  .brand-title {
    font-size: 28px;
  }
}

/* ==========================================
    PORTRAIT/VERTICAL MOBILE OPTIMIZATION
    Reduced top spacing and side margins for
    full content visibility on mobile
    ========================================== */
@media (max-width: 600px) and (orientation: portrait) {
  /* Push card closer to top by changing flex alignment */
  .landing-page {
    justify-content: flex-start;
    padding-top: 20px;
  }

  .recessed-card,
  .landing-panel {
    /* Add side margins for breathing room */
    margin-left: 20px;
    margin-right: 20px;
    /* Reduce top padding to save vertical space */
    padding-top: 28px;
    padding-bottom: 28px;
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Compact brand section */
  .brand-container {
    margin-bottom: 20px;
  }

  .brand-logo {
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
  }

  .brand-title {
    font-size: 26px;
    margin-bottom: 6px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  /* Compact phase containers */
  .phase-title {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .phase-hint {
    font-size: 12px;
    margin-bottom: 16px;
  }

  /* Compact form elements */
  .form-group {
    margin-bottom: 12px;
  }

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

  .form-input {
    padding: 10px 14px;
    font-size: 14px;
  }

  /* Compact checkbox */
  .checkbox-group {
    margin: 14px 0;
  }

  .checkbox-label {
    font-size: 13px;
  }

  /* Compact buttons */
  .btn-group {
    margin-top: 12px;
    gap: 8px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  /* Compact welcome actions */
  .welcome-actions {
    margin-bottom: 20px;
    gap: 8px;
  }

  .action-btn {
    padding: 13px 20px;
    font-size: 14px;
  }

  /* Compact features */
  .features-list {
    margin-top: 16px;
    padding-top: 16px;
  }

  .feature-item {
    font-size: 12px;
    padding: 8px 12px;
  }

  /* Compact auto-join info */
  .auto-join-info {
    padding: 12px;
    margin-bottom: 12px;
  }

  .auto-join-title {
    font-size: 13px;
  }

  .auto-join-description {
    font-size: 12px;
  }
}
