/* Login page — design system CRM v1 */

:root {
  /* Palette */
  --color-primary: #a10075;
  --color-primary-dark: #7a0058;
  --color-primary-light: #e91e8c;
  --color-accent: #b078ff;
  --color-teal: #0d7377;

  /* Sfondi */
  --color-bg: #0b0614;
  --color-surface: rgba(255, 255, 255, 0.08);
  --color-hero-gradient: linear-gradient(115deg, #0b0614 0%, #151026 25%, #2a1a3f 50%, #6b0a4a 75%, #0d7377 100%);

  /* Testo */
  --color-text: #1f1f28;
  --color-text-light: #ffffff;
  --color-muted: rgba(255, 255, 255, 0.7);

  /* Bordi e stati */
  --color-border: rgba(255, 255, 255, 0.18);

  /* Raggio e ombre */
  --radius: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-full: 9999px;
  --shadow-card: 0 24px 60px -12px rgba(0, 0, 0, 0.45);
}

html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text-light);
  line-height: 1.5;
}

footer {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: center;
}

.easter-egg-link {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.easter-egg-link:hover,
.easter-egg-link:focus {
  color: rgba(255, 255, 255, 0.9);
}

section.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--color-hero-gradient);
  position: relative;
  overflow: hidden;
}

section.login-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(176, 120, 255, 0.18), transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(13, 115, 119, 0.25), transparent 45%);
  pointer-events: none;
}

.login-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6rem;
  width: 100%;
  max-width: 1200px;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 3rem 2.5rem;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  color: var(--color-text-light);
  text-decoration: none;
}

.login-brand-logo {
  display: block;
  width: auto;
  height: 2.25rem;
}

.login-brand-dot {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-text-light);
}

.login-brand-sub {
  margin-left: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.02em;
}

.login-subtitle {
  margin: 0 0 2rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-muted);
}

.login-google-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.login-google-icon svg {
  display: block;
}

.login-btn-google,
.login-btn-dev {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
}

.login-btn-google {
  background: rgba(0, 0, 0, 0.45);
  color: var(--color-text-light);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.login-btn-google:hover,
.login-btn-google:focus {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.login-btn-google i {
  font-size: 1rem;
}

.login-btn-dev {
  margin-top: 0.75rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
}

.login-btn-dev:hover,
.login-btn-dev:focus {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-light);
  border-color: rgba(255, 255, 255, 0.25);
}

.login-hero-text {
  max-width: 420px;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
}

.login-hero-text p {
  margin: 0;
}

@media (max-width: 900px) {
  .login-content {
    flex-direction: column;
    gap: 2.5rem;
  }

  .login-hero-text {
    text-align: center;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  /* Footer becomes static so it can never overlap the hero text/card
     when the stacked layout is taller than the viewport. */
  footer {
    position: static;
    padding: 0 1rem 1.25rem;
  }

  section.login-wrapper {
    padding: 2rem 1rem;
    min-height: auto;
  }

  .login-card {
    padding: 2rem 1.5rem;
  }

  .login-brand-logo {
    height: 1.75rem;
  }

  .login-brand-dot {
    font-size: 1.75rem;
  }

  .login-hero-text {
    font-size: 1.25rem;
  }

  footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* Dev login — user card list inside login-card */
.dev-login-form {
  text-align: left;
}

.dev-login-search {
  position: relative;
  margin-bottom: 1rem;
}

.dev-login-search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.125rem;
  color: var(--color-muted);
  pointer-events: none;
}

.dev-login-search-input {
  width: 100%;
  height: 2.75rem;
  padding: 0 1rem 0 2.75rem;
  font-size: 0.9375rem;
  color: var(--color-text-light);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dev-login-search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.dev-login-search-input:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(233, 30, 140, 0.18);
}

.dev-login-user-list {
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 1.25rem;
}

.dev-login-user {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background-color 0.15s ease;
  color: var(--color-text-light);
}

.dev-login-user:last-child {
  border-bottom: 0;
}

.dev-login-user:hover,
.dev-login-user:focus {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.dev-login-user.selected {
  background: rgba(161, 0, 117, 0.22);
  border-left: 3px solid var(--color-primary-light);
  padding-left: calc(1rem - 3px);
}

.dev-login-user-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-light);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-full);
}

.dev-login-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.dev-login-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dev-login-user-email {
  font-size: 0.75rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dev-login-user-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.dev-login-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: var(--radius-full);
}

.dev-login-badge--role {
  color: #fff;
  background: var(--color-teal);
}

.dev-login-badge--access {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.85);
}

.dev-login-empty {
  margin: -0.75rem 0 1.25rem;
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--color-muted);
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
}

.dev-login-submit {
  width: 100%;
  margin-top: 0;
}

.dev-login-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dev-login-submit--error {
  animation: dev-login-shake 0.35s ease;
}

@keyframes dev-login-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@media (max-width: 480px) {
  .dev-login-user-badges {
    display: none;
  }
}
