/* ==============================
   HEADER – ULTRA MODERN (Desktop & Mobile)
============================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 20px;
  background: linear-gradient(135deg, #0288d1, #03a9f4);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  border-radius: 0 0 12px 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
  transition: background 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
  flex-wrap: wrap;
}

.site-header:hover {
  background: linear-gradient(135deg, #03a9f4, #0288d1);
}

/* Logo */
.site-header .logo {
  width: 50px;
  height: 50px;
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, #03a9f4, #0288d1);
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}

.site-header .logo:hover {
  transform: scale(1.08) rotate(5deg);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* Header Texts */
.site-header .header-texts {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.site-header .header-texts h1 {
  font-size: 1.5rem;
  font-weight: 900;
  margin: 0;
  line-height: 1.2;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.25);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.2s ease;
}

.site-header .header-texts h1:hover {
  transform: translateX(2px);
}

.site-header .header-texts h1 small {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #e0f7fa;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
  margin-top: 1px;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.site-header .header-texts h1 small:hover {
  opacity: 1;
}

/* ==============================
   RESPONSIVE IMPROVEMENTS
============================== */
@media (max-width: 768px) {
  .site-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 16px;
    gap: 6px;
  }

  .site-header .logo {
    width: 42px;
    height: 42px;
  }

  .site-header .header-texts h1 {
    font-size: 1.3rem;
    white-space: normal;
    line-height: 1.3;
  }

  .site-header .header-texts h1 small {
    font-size: 0.75rem;
  }

  .site-header::before {
    width: 60%;
  }
}

@media (max-width: 480px) {
  .site-header .logo {
    width: 38px;
    height: 38px;
  }

  .site-header .header-texts h1 {
    font-size: 1.1rem;
  }

  .site-header .header-texts h1 small {
    font-size: 0.7rem;
  }

  .site-header::before {
    width: 50%;
  }
}

/* ==============================
   ANIMATION FOR GRADIENT LINE
============================== */
@keyframes slideGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ==============================
   CONTAINER & FORM (ALWAYS WHITE)
============================== */
.container {
  max-width: 720px;
  margin: 20px auto 0;
  padding: 25px 28px;
  background: #fff !important; /* Force white background */
  color: #333 !important;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-top: 6px solid #2e7d32;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
  z-index: 10;
}

.container:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 80%, rgba(46, 125, 50, 0.02) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(2, 136, 209, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* ==============================
   FORM INTRO HIGHLIGHT
============================== */
.form-intro {
  display: inline-block;
  background: linear-gradient(135deg, #e6f2ff, #f0f8ff);
  color: #c62828; /* RED TEXT */
  font-size: 1rem;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
  border-left: 4px solid #0288d1;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ==============================
   LABELS & INPUTS
============================== */
label {
  display: block;
  margin-top: 16px;
  font-weight: 700;
  color: #2e7d32;
  position: relative;
  transition: color 0.2s ease;
}

label.required::after {
  content: ' *';
  color: #c62828;
  font-weight: 900;
}

.container input[type="text"],
.container input[type="email"],
.container input[type="file"],
.container select {
  width: 100%;
  padding: 14px 16px;
  margin-top: 8px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  background: #fff !important;
  color: #333 !important;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(15px);
  animation: floatIn 0.8s forwards;
  position: relative;
}

.container input:hover,
.container select:hover,
.container input[type="file"]:hover {
  background: #f0f7ff;
  border-color: #64b5f6;
  transform: translateY(-1px);
}

.container input:focus,
.container select:focus {
  outline: none;
  border-color: #0277bd;
  box-shadow: 0 0 0 4px rgba(2,119,189,0.15);
  background: #fff !important;
  color: #333 !important;
  transform: translateY(-2px);
}

/* ==============================
   BUTTON
============================== */
button {
  margin-top: 20px;
  width: 100%;
  padding: 16px 20px;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #c62828, #e53935, #f44336);
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 800;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(20px);
  animation: floatIn 0.8s forwards 0.6s;
  background-size: 300% 300%;
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.2);
  position: relative;
  overflow: hidden;

  /* Subtle neon pulse */
  animation: floatIn 0.8s forwards 0.6s, neonPulse 2.5s ease-in-out infinite;
}

button:hover {
  transform: translateY(-3px) scale(1.03);
  background: linear-gradient(135deg, #ff1744, #f50057, #ff4081);
  box-shadow: 
    0 0 6px #ff1744,
    0 0 12px #f50057,
    0 0 18px #ff4081;
  background-position: 100% 0;
}

@keyframes neonPulse {
  0%, 100% {
    box-shadow: 
      0 0 4px #ff1744,
      0 0 8px #f50057,
      0 0 12px #ff4081;
  }
  50% {
    box-shadow: 
      0 0 6px #ff1744,
      0 0 10px #f50057,
      0 0 14px #ff4081;
  }
}

/* ==============================
   SPINNER
============================== */
.spinner {
  display: none;
  margin: 20px auto;
  border: 4px solid #e6f2ff;
  border-top: 4px solid #c62828;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  position: relative;
}

.spinner::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top: 2px solid #0288d1;
  animation: spin 0.8s linear infinite reverse;
}

/* ==============================
   SUCCESS & ERROR
============================== */
.success,
.error {
  display: none;
  padding: 16px 18px;
  margin-top: 20px;
  border-radius: 10px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-left: 5px solid;
}

.success {
  color: #1b5e20;
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border-left-color: #4caf50;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
}

.success.show {
  display: block;
  opacity: 1;
  transform: translateY(-5px);
  animation: successPulse 0.6s ease-out, fadeOut 5s forwards;
}

.error {
  color: #c62828;
  background: linear-gradient(135deg, #ffebee, #fce4ec);
  border-left-color: #f44336;
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.15);
}

.error.show {
  display: block;
  opacity: 1;
  transform: translateY(-5px);
  animation: errorShake 0.6s ease-out, fadeOut 5s forwards;
}

/* ==============================
   PROGRESS BAR
============================== */
.progress-container {
  display: none;
  margin-top: 12px;
  background: #e0e0e0;
  border-radius: 10px;
  height: 20px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
}

.progress-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 33%, rgba(255,255,255,0.2) 33%, rgba(255,255,255,0.2) 66%, transparent 66%);
  background-size: 20px 20px;
  animation: progressStripes 0.8s linear infinite;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, #2e7d32, #66bb6a, #4caf50);
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

.upload-progress-text {
  display: none;
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2e7d32;
  text-align: center;
  transition: all 0.3s ease;
}

.upload-progress-text.show {
  display: block;
  opacity: 1;
  animation: progressTextPulse 2s ease-in-out infinite;
}

/* ==============================
   FOOTER
============================== */
.site-footer {
  background: linear-gradient(135deg, #fafafa, #f5f5f5);
  color: #666;
  text-align: center;
  padding: 20px 12px;
  font-size: 0.9rem;
  border-top: 1px solid #e0e0e0;
  margin-top: 20px;
}

.site-footer p {
  margin: 0;
  font-weight: 600;
  transition: color 0.2s ease;
}

.site-footer:hover p {
  color: #0288d1;
}

/* ==============================
   ANIMATIONS
============================== */
@keyframes floatIn {
  0% { opacity: 0; transform: translateY(30px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes fadeOut {
  0%, 80% { opacity: 1; }
  100% { opacity: 0; display: none; }
}

@keyframes successPulse {
  0% { transform: translateY(-5px) scale(0.95); }
  50% { transform: translateY(-5px) scale(1.02); }
  100% { transform: translateY(-5px) scale(1); }
}

@keyframes errorShake {
  0%, 100% { transform: translateY(-5px) translateX(0); }
  25% { transform: translateY(-5px) translateX(-5px); }
  75% { transform: translateY(-5px) translateX(5px); }
}

@keyframes progressStripes {
  0% { background-position: 0 0; }
  100% { background-position: 20px 0; }
}

@keyframes progressTextPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ==============================
   DARK MODE FOR PAGE ONLY
============================== */
@media (prefers-color-scheme: dark) {
  body {
    background: #121212;
    color: #ddd;
  }
  /* The form remains white! */
  .container {
    background: #fff !important;
    color: #333 !important;
  }
}

/* ==============================
   ACCESSIBILITY
============================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.container input:focus-visible,
.container select:focus-visible,
button:focus-visible {
  outline: 3px solid #0277bd;
  outline-offset: 2px;
}

/* ==============================
   RESPONSIVE IMPROVEMENTS
============================== */
@media (max-width: 600px) {
  .site-header {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .container {
    margin: 15px;
    padding: 20px 16px;
    border-radius: 8px;
  }

  .form-intro {
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  button {
    padding: 14px 16px;
    font-size: 1rem;
  }
}
