*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.4s ease, color 0.4s ease,
    border-color 0.4s ease, box-shadow 0.4s ease;
}

:root {
  --background: 0 0% 100%;
  --foreground: 0 0% 10%;
  --card: 0 0% 98%;
  --card-foreground: 0 0% 20%;
  --primary: 16 100% 50%;
  --primary-glow: 20 100% 55%;
  --accent: 25 95% 45%;
  --border: 0 0% 90%;
  --input: 0 0% 92%;
  --glass-bg: 0 0% 96%;
  --radius: 1rem;
  --max-width: 1200px;

  --gradient-primary: linear-gradient(
    135deg,
    hsl(16 100% 50%) 0%,
    hsl(20 100% 55%) 100%
  );
  --shadow-glow: 0 0 40px hsl(16 100% 50% / 0.3);
  --shadow-card: 0 10px 30px -10px hsl(0 0% 0% / 0.1);
  --footer-height: 4rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: 20 14% 8%;
    --foreground: 30 10% 95%;
    --card: 20 12% 10%;
    --card-foreground: 30 10% 95%;
    --primary: 16 100% 60%;
    --primary-glow: 20 100% 65%;
    --accent: 25 95% 55%;
    --border: 20 8% 20%;
    --input: 20 8% 18%;
    --glass-bg: 20 12% 12%;
    --radius: 1rem;
    --max-width: 1200px;

    --gradient-primary: linear-gradient(
      135deg,
      hsl(16 100% 60%) 0%,
      hsl(20 100% 65%) 100%
    );
    --shadow-glow: 0 0 40px hsl(16 100% 60% / 0.3);
    --shadow-card: 0 10px 30px -10px hsl(0 0% 0% / 0.5);
  }
}

html {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

h1,
h2,
h3,
h4 {
  font-weight: 800;
  background: hsl(var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

p {
  color: hsl(var(--foreground) / 0.7);
  line-height: 1.7;
  font-size: 1.125rem;
}

a {
  color: hsl(var(--primary));
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: hsl(var(--primary-glow));
}

button {
  cursor: pointer;
  transition: all 0.3s ease;
}

input,
textarea,
select {
  background: hsl(var(--input));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: hsl(var(--foreground));
  transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.2);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.back-btn {
  position: absolute;
  left: 0;
  background: hsl(var(--glass-bg));
  backdrop-filter: blur(12px);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: hsl(var(--foreground));
  font-size: 1.4rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  z-index: 10;
}

.back-btn:hover {
  background: hsl(var(--accent));
  color: white;
  transform: scale(1.1);
}

button:disabled, button[disabled] {
  background-color: hsl(var(--border));
  color: hsl(var(--foreground) / 0.5);
  cursor: not-allowed;
  border: 1px solid hsl(var(--border));
  opacity: 0.6;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1.5rem;
  border: 4px solid hsl(var(--primary-glow));
  box-shadow: 0 0 20px hsl(var(--primary-glow) / 0.4);
  position: relative;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: hsl(var(--primary-glow));
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.profile-avatar:hover .avatar-upload {
  opacity: 1;
}

main{
  margin-bottom: var(--footer-height);
}

.btn-primary {
  display: inline-block;
  background: hsl(var(--primary));
  color: white;
  padding: 0.9rem 1.8rem;
  border-radius: var(--radius);
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary:hover {
  background: hsl(16 100% 50%);
}

/* Error Alert */
.alert-error {
  margin-top: 1.5rem;
  padding: 1.1rem 1.3rem;
  background: hsl(0 84% 60% / 0.18);
  border: 1px solid hsl(0 84% 60% / 0.4);
  border-radius: var(--radius);
  color: hsl(0 84% 60%);
  font-weight: 600;
  font-size: 0.98rem;
  text-align: center;
  animation: shake 0.6s ease-in-out;
  backdrop-filter: blur(8px);
}

.alert-success {
  margin-top: 1.5rem;
  padding: 1.1rem 1.3rem;
  background: hsla(142, 77%, 48%, 0.18);
  border: 1px solid hsla(107, 92%, 46%, 0.4);
  border-radius: var(--radius);
  color: hsl(142, 91%, 46%);
  font-weight: 600;
  font-size: 0.98rem;
  text-align: center;
  animation: shake 0.6s ease-in-out;
  backdrop-filter: blur(8px);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

body {
  font-size: clamp(1rem, 2vw + 0.5rem, 1.25rem);
}

@media (max-width: 480px) {
  body {
    font-size: 1rem; 
  }
}