/* ==============================================
   COMPTE.LAYERONE.FR - Portal Styles
   Based on LayerOne design system
   ============================================== */

/* ========== DESIGN TOKENS ========== */
:root {
  /* Accent Colors */
  --accent-blue: rgb(66, 133, 255);
  --accent-purple: rgb(140, 100, 240);
  --accent-pink: rgb(236, 72, 180);
  --accent-primary: var(--accent-blue);
  --accent-gradient: linear-gradient(135deg, var(--accent-blue), var(--accent-purple), var(--accent-pink));

  /* Text Colors */
  --text-primary: rgb(51, 64, 89);
  --text-secondary: rgb(102, 115, 140);
  --text-muted: rgb(128, 140, 163);
  --text-white: #ffffff;

  /* Background & Borders */
  --border-light: rgb(217, 222, 230);
  --background-card: rgba(255, 255, 255, 0.95);
  --background-input: rgb(255, 255, 255);
  --background-body: rgb(248, 250, 252);

  /* Semantic Colors */
  --success: rgb(0, 170, 68);
  --danger: rgb(221, 0, 0);
  --warning: rgb(255, 136, 0);

  /* Wave backgrounds */
  --wave-1: rgba(66, 133, 255, 0.25);
  --wave-2: rgba(140, 100, 240, 0.20);
  --wave-3: rgba(236, 72, 180, 0.15);

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.25rem;
  --space-2xl: 1.5rem;
  --space-3xl: 2rem;
  --space-4xl: 2.5rem;

  /* Layout */
  --container-max: 1200px;
  --nav-height: 72px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 25px 50px rgba(0, 0, 0, 0.15);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  font-family: var(--font-family);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  background: var(--background-body);
  position: relative;
  overflow-x: hidden;
}

/* ========== ANIMATED BACKGROUND ========== */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(135deg, rgb(248, 250, 255), rgb(245, 248, 255), rgb(250, 248, 252));
}

.wave {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: float 20s ease-in-out infinite;
}

.wave-1 {
  width: 600px;
  height: 600px;
  background: var(--wave-1);
  top: -200px;
  left: -100px;
  animation-delay: 0s;
}

.wave-2 {
  width: 500px;
  height: 500px;
  background: var(--wave-2);
  top: 50%;
  right: -150px;
  animation-delay: -5s;
}

.wave-3 {
  width: 400px;
  height: 400px;
  background: var(--wave-3);
  bottom: -100px;
  left: 30%;
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -30px) scale(1.05);
  }
  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }
  75% {
    transform: translate(-30px, -20px) scale(1.02);
  }
}

/* ========== CONTAINER ========== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ========== NAVBAR ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  z-index: 100;
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.125rem;
}

.navbar-logo img {
  height: 32px;
  width: auto;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.navbar-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.navbar-link:hover {
  color: var(--text-primary);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.user-email {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ========== MAIN CONTENT ========== */
main {
  flex: 1;
  padding-top: var(--nav-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== AUTH PAGES ========== */
.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-lg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--background-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: var(--space-4xl);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: var(--space-xl);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.form-input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-size: 0.9375rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--background-input);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(66, 133, 255, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-error {
  color: var(--danger);
  font-size: 0.8125rem;
  margin-top: var(--space-xs);
}

.form-hint {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: var(--space-xs);
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--text-white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-primary);
  padding: var(--space-sm) var(--space-md);
}

.btn-ghost:hover {
  background: rgba(66, 133, 255, 0.1);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: 1rem;
}

/* ========== ALERTS ========== */
.alert {
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.alert-error {
  background: rgba(221, 0, 0, 0.1);
  border: 1px solid rgba(221, 0, 0, 0.3);
  color: var(--danger);
}

.alert-success {
  background: rgba(0, 170, 68, 0.1);
  border: 1px solid rgba(0, 170, 68, 0.3);
  color: var(--success);
}

.alert-info {
  background: rgba(66, 133, 255, 0.1);
  border: 1px solid rgba(66, 133, 255, 0.3);
  color: var(--accent-primary);
}

.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.alert-content {
  flex: 1;
}

/* ========== AUTH FOOTER LINKS ========== */
.auth-footer {
  text-align: center;
  margin-top: var(--space-2xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--border-light);
}

.auth-footer p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.auth-footer a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ========== DASHBOARD ========== */
.dashboard-container {
  padding: var(--space-3xl) var(--space-lg);
}

.dashboard-header {
  margin-bottom: var(--space-4xl);
}

.dashboard-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.dashboard-header p {
  color: var(--text-secondary);
}

/* ========== CARDS ========== */
.card {
  background: var(--background-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ========== DOWNLOAD CARDS ========== */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.download-card {
  background: var(--background-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: var(--space-2xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.download-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.download-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  border-radius: var(--radius-lg);
  color: white;
}

.download-icon svg {
  width: 32px;
  height: 32px;
}

.download-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.download-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--space-xl);
}

.download-card .btn {
  margin-top: auto;
}

/* ========== USER INFO CARD ========== */
.user-info-card {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-xl);
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.info-value {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ========== DOWNLOAD HISTORY ========== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.history-item {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-md);
}

.history-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  color: white;
  flex-shrink: 0;
}

.history-icon svg {
  width: 20px;
  height: 20px;
}

.history-details {
  flex: 1;
}

.history-app {
  font-weight: 500;
  color: var(--text-primary);
}

.history-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.history-empty {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--text-muted);
}

/* ========== CHECK EMAIL PAGE ========== */
.check-email-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  border-radius: 50%;
  color: white;
}

.check-email-icon svg {
  width: 40px;
  height: 40px;
}

/* ========== VERIFY PAGE ========== */
.verify-status {
  text-align: center;
}

.verify-status.success .verify-icon {
  background: rgba(0, 170, 68, 0.1);
  color: var(--success);
}

.verify-status.error .verify-icon {
  background: rgba(221, 0, 0, 0.1);
  color: var(--danger);
}

.verify-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.verify-icon svg {
  width: 40px;
  height: 40px;
}

/* ========== LOADING STATE ========== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ========== FOOTER ========== */
.footer {
  margin-top: auto;
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .auth-card {
    padding: var(--space-2xl);
  }

  .downloads-grid {
    grid-template-columns: 1fr;
  }

  .user-info-card {
    grid-template-columns: 1fr;
  }

  .navbar-nav {
    display: none;
  }
}

/* ========== DARK MODE ========== */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: rgb(230, 235, 245);
    --text-secondary: rgb(180, 190, 210);
    --text-muted: rgb(140, 150, 170);
    --border-light: rgb(60, 70, 90);
    --background-card: rgba(30, 35, 50, 0.95);
    --background-input: rgb(40, 45, 60);
    --background-body: rgb(20, 25, 40);
  }

  .animated-bg {
    background: linear-gradient(135deg, rgb(12, 15, 30), rgb(20, 22, 45), rgb(15, 18, 38));
  }

  .navbar {
    background: rgba(30, 35, 50, 0.8);
  }

  .history-item {
    background: rgba(255, 255, 255, 0.03);
  }
}
