/* Reset e stili base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: linear-gradient(135deg, #E8F4F8 0%, #D4E9F7 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #1a1a1a;
}

/* Pagina Login */
.login-page {
  background: #fff;
}

.login-container {
  background: white;
  padding: 4rem 3rem;
  border: 2px solid #1a1a1a;
  max-width: 420px;
  width: 90%;
  position: relative;
  text-align: center;
}

.login-container h1 {
  color: #1a1a1a;
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  color: #666;
  font-size: 1rem;
  margin-bottom: 3rem;
  font-weight: 400;
}

.login-form {
  margin-top: 2rem;
}

.input-group {
  margin-bottom: 2rem;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 0.8rem;
  color: #1a1a1a;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-group input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #1a1a1a;
  background: white;
  font-size: 1rem;
  transition: all 0.2s;
}

.input-group input:focus {
  outline: none;
  border-color: #4A90E2;
  background: #f0f8ff;
}

.btn-primary {
  width: 100%;
  padding: 1.2rem;
  background: #4A90E2;
  color: white;
  border: 2px solid #4A90E2;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-primary:hover {
  background: white;
  color: #4A90E2;
}

.error-message {
  background: #E74C3C;
  color: white;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  border: 2px solid #1a1a1a;
}

.hearts-decoration {
  margin-top: 3rem;
  font-size: 1.2rem;
  opacity: 0.2;
}

.hearts-decoration .heart {
  display: inline-block;
  margin: 0 0.5rem;
}

/* Pagina Welcome */
.welcome-page {
  background: white;
}

.welcome-container {
  text-align: center;
  max-width: 900px;
  padding: 2rem;
}

.welcome-container h1 {
  font-size: 4rem;
  margin-bottom: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #1a1a1a 0%, #4A90E2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.message-box {
  background: #fff;
  padding: 3rem;
  border: 3px solid #4A90E2;
  margin-bottom: 3rem;
  box-shadow: 0 8px 25px rgba(74, 144, 226, 0.1);
}

.love-message {
  color: #1a1a1a;
  font-size: 1.1rem;
  line-height: 1.8;
  font-weight: 400;
}

.btn-start {
  display: inline-block;
  padding: 1.5rem 4rem;
  background: linear-gradient(135deg, #4A90E2 0%, #5B9BD5 100%);
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s;
  border: 2px solid #4A90E2;
}

.btn-start:hover {
  background: white;
  color: #4A90E2;
}

/* Animazioni - Minimal */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-in;
}

.animate-slide-up {
  animation: slideUp 0.6s ease-out;
}

.hearts-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.floating-heart {
  position: absolute;
  font-size: 3rem;
  opacity: 0.05;
}

/* Pagina Coloring */
.coloring-page {
  background: linear-gradient(135deg, #E8F4F8 0%, #D4E9F7 100%);
  display: block;
  padding: 0;
}

.coloring-container {
  width: 100%;
  min-height: 100vh;
  padding: 2rem;
}

.coloring-header {
  text-align: center;
  margin-bottom: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 3px solid #4A90E2;
  padding-bottom: 2rem;
}

.coloring-header h1 {
  flex: 1;
  font-weight: 700;
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  color: #1a1a1a;
  background: linear-gradient(135deg, #1a1a1a 0%, #4A90E2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-back {
  background: white;
  color: #1a1a1a;
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  font-weight: 600;
  border: 2px solid #1a1a1a;
  transition: all 0.2s;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.btn-back:hover {
  background: #1a1a1a;
  color: white;
}

/* Galleria */
.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid #1a1a1a;
}

.gallery-item:hover {
  transform: scale(1.02);
  border-color: #4A90E2;
  box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}

.gallery-item img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
  transition: filter 0.3s;
}

.gallery-item:hover img {
  filter: grayscale(0%);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.95) 0%, rgba(91, 155, 213, 0.95) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.btn-color {
  background: white;
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
  padding: 1rem 2rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-color:hover {
  background: #1a1a1a;
  color: white;
}

/* Workspace di colorazione */
.coloring-workspace {
  background: white;
  padding: 2rem;
  border: 3px solid #4A90E2;
  margin-top: 2rem;
  text-align: center;
  box-shadow: 0 10px 40px rgba(74, 144, 226, 0.15);
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #D4E9F7;
}

.workspace-header h2 {
  color: #1a1a1a;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.btn-close {
  background: white;
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-close:hover {
  background: #1a1a1a;
  color: white;
}

/* Barra degli strumenti */
.tools-bar {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  background: #E8F4F8;
  margin-bottom: 2rem;
  border: 2px solid #4A90E2;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tool-group label {
  font-weight: 700;
  color: #1a1a1a;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

input[type="range"] {
  width: 150px;
  height: 4px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: #4A90E2;
  cursor: pointer;
  border: 2px solid #1a1a1a;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #4A90E2;
  cursor: pointer;
  border: 2px solid #1a1a1a;
}

.btn-tool {
  background: white;
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.btn-tool:hover {
  background: #4A90E2;
  color: white;
  border-color: #4A90E2;
}

/* Canvas */
.canvas-container {
  position: relative;
  display: block;
  max-width: 700px;
  width: 90%;
  margin: 2rem auto;
  overflow: auto;
  border: 3px solid #1a1a1a;
  background: white;
  box-shadow: 0 10px 30px rgba(74, 144, 226, 0.2);
}

#colorCanvas,
#bwCanvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

#colorCanvas {
  position: relative;
}

#bwCanvas {
  position: absolute;
  top: 0;
  left: 0;
  cursor: crosshair;
}

/* Responsive */
@media (max-width: 768px) {
  .welcome-container h1 {
    font-size: 2.5rem;
  }

  .canvas-container {
    max-width: 95%;
    width: 95%;
  }

  #colorCanvas,
  #bwCanvas {
    max-height: 60vh;
  }

  .coloring-header {
    flex-direction: column;
    gap: 1rem;
  }

  .tools-bar {
    flex-direction: column;
    gap: 1.5rem;
  }

  .tool-group {
    width: 100%;
    justify-content: space-between;
  }

  .gallery-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .login-container h1 {
    font-size: 2rem;
  }
}
