:root {
  --bg-day: #f8fafc;
  --bg-night: #020617;
  --glass-bg-day: rgba(255, 255, 255, 0.7);
  --glass-bg-night: rgba(15, 23, 42, 0.6);
  --glass-border-day: rgba(255, 255, 255, 0.8);
  --glass-border-night: rgba(255, 255, 255, 0.1);
  --accent: #3b82f6;
  --text-day: #1e293b;
  --text-night: #f1f5f9;
  --ball-1: #3b82f6;
  --ball-2: #8b5cf6;
  --ball-3: #ec4899;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background 0.5s ease;
  position: relative;
}

body.day-mode { background: var(--bg-day); color: var(--text-day); }
body.night-mode { background: var(--bg-night); color: var(--text-night); }

.mesh-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  filter: blur(100px);
  opacity: 0.4;
  overflow: hidden;
}

.mesh-ball {
  position: absolute;
  border-radius: 50%;
}

.ball-1 { width: 400px; height: 400px; background: var(--ball-1); top: 10%; left: 10%; }
.ball-2 { width: 500px; height: 500px; background: var(--ball-2); bottom: 10%; right: 10%; }
.ball-3 { width: 300px; height: 300px; background: var(--ball-3); top: 40%; left: 50%; }

.header-tools {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-switch {
  --toggle-size: 15px;
  --container-width: 5.625em;
  --container-height: 2.5em;
  --container-radius: 6.25em;
  --container-light-bg: #3D7EAE;
  --container-night-bg: #1D1F2C;
  --circle-container-diameter: 3.375em;
  --sun-moon-diameter: 2.125em;
  --sun-bg: #ECCA2F;
  --moon-bg: #C4C9D1;
  --spot-color: #959DB1;
  --circle-container-offset: calc((var(--circle-container-diameter) - var(--container-height)) / 2 * -1);
  --stars-color: #fff;
  --clouds-color: #F3FDFF;
  --back-clouds-color: #AACADF;
  --transition: .5s cubic-bezier(0, -0.02, 0.4, 1.25);
  --circle-transition: .3s cubic-bezier(0, -0.02, 0.35, 1.17);
  display: block;
}

.theme-switch, .theme-switch * {
  box-sizing: border-box;
  font-size: var(--toggle-size);
}

.theme-switch__container {
  width: var(--container-width);
  height: var(--container-height);
  background-color: var(--container-light-bg);
  border-radius: var(--container-radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0em -0.062em 0.062em rgba(0, 0, 0, 0.25), 0em 0.062em 0.125em rgba(255, 255, 255, 0.94);
  transition: var(--transition);
  position: relative;
}

.theme-switch__checkbox { display: none; }

.theme-switch__circle-container {
  width: var(--circle-container-diameter);
  height: var(--circle-container-diameter);
  background-color: rgba(255, 255, 255, 0.1);
  position: absolute;
  left: var(--circle-container-offset);
  top: var(--circle-container-offset);
  border-radius: var(--container-radius);
  box-shadow: inset 0 0 0 3.375em rgba(255, 255, 255, 0.1), 0 0 0 0.625em rgba(255, 255, 255, 0.1), 0 0 0 1.25em rgba(255, 255, 255, 0.1);
  display: flex;
  transition: var(--circle-transition);
  pointer-events: none;
}

.theme-switch__sun-moon-container {
  pointer-events: auto;
  position: relative;
  z-index: 2;
  width: var(--sun-moon-diameter);
  height: var(--sun-moon-diameter);
  margin: auto;
  border-radius: var(--container-radius);
  background-color: var(--sun-bg);
  box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset, 0em -0.062em 0.062em 0em #a1872a inset;
  filter: drop-shadow(0.062em 0.125em 0.125em rgba(0, 0, 0, 0.25));
  overflow: hidden;
  transition: var(--transition);
}

.theme-switch__moon {
  transform: translateX(100%);
  width: 100%;
  height: 100%;
  background-color: var(--moon-bg);
  border-radius: inherit;
  box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset, 0em -0.062em 0.062em 0em #969696 inset;
  transition: var(--transition);
  position: relative;
}

.theme-switch__spot {
  position: absolute;
  top: 0.75em;
  left: 0.312em;
  width: 0.75em;
  height: 0.75em;
  border-radius: var(--container-radius);
  background-color: var(--spot-color);
  box-shadow: 0em 0.0312em 0.062em rgba(0, 0, 0, 0.25) inset;
}

.theme-switch__spot:nth-of-type(2) { width: 0.375em; height: 0.375em; top: 0.937em; left: 1.375em; }
.theme-switch__spot:nth-last-of-type(3) { width: 0.25em; height: 0.25em; top: 0.312em; left: 0.812em; }

.theme-switch__clouds {
  width: 1.25em;
  height: 1.25em;
  background-color: var(--clouds-color);
  border-radius: var(--container-radius);
  position: absolute;
  bottom: -0.625em;
  left: 0.312em;
  box-shadow: 0.937em 0.312em var(--clouds-color), -0.312em -0.312em var(--back-clouds-color), 1.437em 0.375em var(--clouds-color), 0.5em -0.125em var(--back-clouds-color), 2.187em 0 var(--clouds-color), 1.25em -0.062em var(--back-clouds-color), 2.937em 0.312em var(--clouds-color), 2em -0.312em var(--back-clouds-color), 3.625em -0.062em var(--clouds-color), 2.625em 0em var(--back-clouds-color), 4.5em -0.312em var(--clouds-color), 3.375em -0.437em var(--back-clouds-color), 4.625em -1.75em 0 0.437em var(--clouds-color), 4em -0.625em var(--back-clouds-color), 4.125em -2.125em 0 0.437em var(--back-clouds-color);
  transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
}

.theme-switch__stars-container {
  position: absolute;
  color: var(--stars-color);
  top: -100%;
  left: 0.312em;
  width: 2.75em;
  height: auto;
  transition: var(--transition);
}

.theme-switch__checkbox:checked + .theme-switch__container { background-color: var(--container-night-bg); }
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__circle-container {
  left: calc(100% - var(--circle-container-offset) - var(--circle-container-diameter));
}
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__moon { transform: translate(0); }
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__clouds { bottom: -4.062em; }
.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__stars-container {
  top: 50%;
  transform: translateY(-50%);
}

.main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 40px 20px;
  z-index: 10;
}

.card {
  width: 100%;
  max-width: 480px;
  padding: 50px;
  border-radius: 32px;
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  transition: all 0.5s ease;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.2);
  text-align: center;
}

body.day-mode .card { background: var(--glass-bg-day); border: 1px solid var(--glass-border-day); }
body.night-mode .card { background: var(--glass-bg-night); border: 1px solid var(--glass-border-night); }

.card-header h2 { font-size: 32px; font-weight: 600; margin-bottom: 8px; }
.card-header p { font-size: 15px; opacity: 0.6; margin-bottom: 40px; }

.input-field { position: relative; margin-bottom: 35px; text-align: left; }
.input-field input, .input-field textarea {
  width: 100%; background: transparent; border: none; border-bottom: 2px solid rgba(128, 128, 128, 0.2);
  padding: 12px 0; font-size: 16px; color: inherit; outline: none; transition: 0.3s;
}

.input-field label { position: absolute; left: 0; top: 12px; pointer-events: none; transition: 0.3s; opacity: 0.5; }
.input-field input:focus ~ label, .input-field input:not(:placeholder-shown) ~ label,
.input-field textarea:focus ~ label, .input-field textarea:not(:placeholder-shown) ~ label {
  top: -24px; font-size: 13px; opacity: 1; font-weight: 600; color: var(--accent);
}

.underline { position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--accent); transition: 0.4s; }
.input-field input:focus ~ .underline, .input-field textarea:focus ~ .underline { width: 100%; }

button {
  position: relative;
  margin: 0;
  width: 100%;
  padding: 0.8em 1em;
  outline: none;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
  background-color: #1e293b;
  border-radius: 10px;
  color: #fff;
  font-weight: 300;
  font-size: 18px;
  font-family: inherit;
  z-index: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.02, 0.01, 0.47, 1);
}

body.day-mode button { background-color: #334155; }
body.night-mode button { background-color: #1e293b; }

button:hover { animation: sh0 0.5s ease-in-out both; }

@keyframes sh0 {
  0% { transform: rotate(0deg) translate3d(0, 0, 0); }
  25% { transform: rotate(7deg) translate3d(0, 0, 0); }
  50% { transform: rotate(-7deg) translate3d(0, 0, 0); }
  75% { transform: rotate(1deg) translate3d(0, 0, 0); }
  100% { transform: rotate(0deg) translate3d(0, 0, 0); }
}

button::before,
button::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: transform 0.15s cubic-bezier(0.02, 0.01, 0.47, 1), opacity 0.15s cubic-bezier(0.02, 0.01, 0.47, 1);
  z-index: -1;
  transform: translate(100%, -25%) translate3d(0, 0, 0);
}

button:hover::before,
button:hover::after {
  opacity: 0.15;
  transition: transform 0.2s cubic-bezier(0.02, 0.01, 0.47, 1), opacity 0.2s cubic-bezier(0.02, 0.01, 0.47, 1);
}

button:hover::before { transform: translate3d(50%, 0, 0) scale(0.9); }
button:hover::after { transform: translate(50%, 0) scale(1.1); }

button:disabled { opacity: 0.5; cursor: not-allowed; animation: none; }

.status { margin-top: 25px; font-size: 14px; padding: 12px; display: none; }
.status.success { color: #10b981; }
.status.error { color: #ef4444; }

.footer { margin-top: 40px; opacity: 0.4; font-size: 12px; font-weight: 300; }
