* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 15px 40px;
  overflow-x: hidden;
  position: relative;
  transition: background 0.5s ease;
}

/* Night Mode Styles */
body.night-mode {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.container {
  position: relative;
  width: 100%;
  max-width: 420px;
  flex-shrink: 0;
}

/* Theme Toggle */
.theme-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
}

.theme-switch {
  position: relative;
  width: 60px;
  height: 30px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.theme-switch:hover {
  background: rgba(255, 255, 255, 0.4);
}

.theme-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

body.night-mode .theme-slider {
  transform: translateX(30px);
  background: #ffd700;
}

.theme-icon {
  transition: all 0.3s ease;
}

/* Cat Styles */
.cat-container {
  position: relative;
  width: 100%;
  height: 100px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  z-index: 10;
  transition: transform 0.3s ease;
}

.cat {
  width: 120px;
  height: 120px;
  position: relative;
  cursor: pointer;
  margin-top: -20px;
  transition: all 0.5s ease;
}

/* Sleeping Cat Position */
body.night-mode .cat {
  transform: rotate(15deg);
  margin-top: -10px;
}

.cat-body {
  width: 80px;
  height: 65px;
  background: linear-gradient(135deg, #ff9a56 0%, #ff6a00 100%);
  border-radius: 50% 50% 40% 40%;
  position: absolute;
  bottom: 0;
  left: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.5s ease;
}

body.night-mode .cat-body {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.cat-head {
  width: 65px;
  height: 58px;
  background: linear-gradient(135deg, #ff9a56 0%, #ff6a00 100%);
  border-radius: 50%;
  position: absolute;
  top: 18px;
  left: 27px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  transition: all 0.5s ease;
}

body.night-mode .cat-head {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.ear {
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 28px solid #ff9a56;
  position: absolute;
  top: -12px;
  transition: all 0.5s ease;
}

.ear.left {
  left: 4px;
  transform: rotate(-20deg);
}

.ear.right {
  right: 4px;
  transform: rotate(20deg);
}

.ear-inner {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid #ffb380;
  position: absolute;
  top: 6px;
  left: -8px;
  transition: all 0.5s ease;
}

.eye {
  width: 14px;
  height: 16px;
  background: #333;
  border-radius: 50%;
  position: absolute;
  top: 24px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.eye.left {
  left: 16px;
}

.eye.right {
  right: 16px;
}

.eye::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  animation: twinkle 3s infinite;
}

body.night-mode .eye::before {
  display: none;
}

.eye.closed {
  height: 2px;
  background: #333;
  border-radius: 0;
}

.eye.closed::before {
  display: none;
}

/* Night mode - always closed eyes */
body.night-mode .eye {
  height: 2px;
  background: #333;
  border-radius: 0;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.nose {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 5px solid #d64545;
  position: absolute;
  top: 36px;
  left: 26px;
  transition: all 0.5s ease;
}

.mouth {
  width: 24px;
  height: 12px;
  border: 2px solid #333;
  border-top: none;
  border-radius: 0 0 50% 50%;
  position: absolute;
  top: 40px;
  left: 20px;
  transition: all 0.5s ease;
}

.whisker {
  width: 32px;
  height: 1px;
  background: #333;
  position: absolute;
  top: 34px;
  transition: all 0.5s ease;
}

.whisker.left-1 {
  left: -28px;
  transform: rotate(-10deg);
}

.whisker.left-2 {
  left: -28px;
  top: 38px;
  transform: rotate(-5deg);
}

.whisker.right-1 {
  right: -28px;
  transform: rotate(10deg);
}

.whisker.right-2 {
  right: -28px;
  top: 38px;
  transform: rotate(5deg);
}

.tail {
  width: 48px;
  height: 48px;
  border: 12px solid #ff9a56;
  border-radius: 50%;
  border-bottom-color: transparent;
  border-left-color: transparent;
  position: absolute;
  bottom: 8px;
  right: -16px;
  transform: rotate(30deg);
  animation: wag 2s ease-in-out infinite;
  transition: all 0.5s ease;
}

body.night-mode .tail {
  animation: none;
  transform: rotate(45deg);
}

@keyframes wag {
  0%,
  100% {
    transform: rotate(30deg);
  }
  50% {
    transform: rotate(45deg);
  }
}

/* Sleeping Z's */
.sleeping-z {
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 20px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.8);
  opacity: 0;
  transition: all 0.5s ease;
}

body.night-mode .sleeping-z {
  opacity: 1;
  animation: floatZ 3s ease-in-out infinite;
}

@keyframes floatZ {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-15px) rotate(10deg);
    opacity: 1;
  }
}

.sleeping-z:nth-child(2) {
  font-size: 16px;
  top: -35px;
  right: -35px;
  animation-delay: 0.5s;
}

.sleeping-z:nth-child(3) {
  font-size: 12px;
  top: -45px;
  right: -45px;
  animation-delay: 1s;
}

/* Form Styles */
.form-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 30px 25px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  width: 100%;
  overflow: visible;
  transition: all 0.5s ease;
}

body.night-mode .form-container {
  background: rgba(30, 30, 45, 0.95);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.form-header {
  text-align: center;
  margin-bottom: 25px;
}

.form-header h2 {
  color: #333;
  font-size: 24px;
  margin-bottom: 8px;
  font-weight: 700;
  transition: color 0.5s ease;
}

body.night-mode .form-header h2 {
  color: #e0e0e0;
}

.form-header p {
  color: #666;
  font-size: 13px;
  line-height: 1.4;
  transition: color 0.5s ease;
}

body.night-mode .form-header p {
  color: #b0b0b0;
}

.form-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
  background: #f0f0f0;
  border-radius: 10px;
  padding: 3px;
  transition: all 0.5s ease;
}

body.night-mode .form-toggle {
  background: #2a2a3e;
}

.toggle-btn {
  flex: 1;
  padding: 12px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

body.night-mode .toggle-btn {
  color: #b0b0b0;
}

.toggle-btn.active {
  background: white;
  color: #667eea;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

body.night-mode .toggle-btn.active {
  background: #3a3a4e;
  color: #8b7fd6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.form-group {
  margin-bottom: 18px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.5s ease;
}

body.night-mode .form-group label {
  color: #d0d0d0;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  padding-right: 50px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: white;
  -webkit-appearance: none;
  appearance: none;
  color: #333;
}

body.night-mode .form-group input {
  background: #2a2a3e;
  border-color: #3a3a4e;
  color: #e0e0e0;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

body.night-mode .form-group input:focus {
  border-color: #8b7fd6;
  box-shadow: 0 0 0 3px rgba(139, 127, 214, 0.2);
}

.form-group input::placeholder {
  color: #999;
  transition: color 0.5s ease;
}

body.night-mode .form-group input::placeholder {
  color: #707090;
}

/* Improved Password Toggle Eye */
.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 2;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.password-toggle:hover {
  transform: translateY(-50%) scale(1.1);
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

.eye-icon {
  width: 20px;
  height: 20px;
  position: relative;
  transition: all 0.3s ease;
}

/* Improved Eye Design */
.eye-icon::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: transparent;
  border: 2px solid #666;
  border-radius: 50%;
  top: 1px;
  left: 1px;
  transition: all 0.3s ease;
}

body.night-mode .eye-icon::before {
  border-color: #b0b0b0;
}

.eye-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: #666;
  border-radius: 50%;
  top: 6px;
  left: 6px;
  transition: all 0.3s ease;
}

body.night-mode .eye-icon::after {
  background: #b0b0b0;
}

/* Closed Eye State */
.eye-icon.closed::before {
  border-color: #999;
  background: rgba(153, 153, 153, 0.1);
}

body.night-mode .eye-icon.closed::before {
  border-color: #909090;
  background: rgba(144, 144, 144, 0.1);
}

.eye-icon.closed::after {
  display: none;
}

/* Eye Slash Line */
.eye-icon.closed::before {
  position: relative;
}

.eye-icon.closed::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  background: #999;
  top: 9px;
  left: -2px;
  transform: rotate(-45deg);
  border-radius: 1px;
  display: block;
}

body.night-mode .eye-icon.closed::after {
  background: #909090;
}

.checkbox-group {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  border: 2px solid #667eea;
  border-radius: 4px;
  position: relative;
  transition: all 0.3s ease;
}

body.night-mode .checkbox-group input[type="checkbox"] {
  border-color: #8b7fd6;
}

.checkbox-group input[type="checkbox"]:checked {
  background: #667eea;
}

body.night-mode .checkbox-group input[type="checkbox"]:checked {
  background: #8b7fd6;
}

.checkbox-group input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.checkbox-group label {
  color: #666;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: color 0.5s ease;
}

body.night-mode .checkbox-group label {
  color: #d0d0d0;
}

.submit-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

body.night-mode .submit-btn {
  background: linear-gradient(135deg, #8b7fd6 0%, #6b5a95 100%);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

body.night-mode .submit-btn:hover {
  box-shadow: 0 10px 30px rgba(139, 127, 214, 0.3);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.submit-btn:active::after {
  width: 300px;
  height: 300px;
}

.form-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  transition: all 0.5s ease;
}

body.night-mode .form-footer {
  border-top-color: #3a3a4e;
}

.form-footer a {
  color: #667eea;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease;
}

body.night-mode .form-footer a {
  color: #8b7fd6;
}

.form-footer a:hover {
  color: #764ba2;
}

body.night-mode .form-footer a:hover {
  color: #a090c0;
}

.success-message {
  display: none;
  padding: 15px;
  background: #4caf50;
  color: white;
  border-radius: 12px;
  margin-bottom: 20px;
  text-align: center;
  animation: slideIn 0.5s ease;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.5s ease;
}

body.night-mode .success-message {
  background: #2e7d32;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-message {
  display: none;
  padding: 15px;
  background: #f44336;
  color: white;
  border-radius: 12px;
  margin-bottom: 20px;
  text-align: center;
  animation: shake 0.5s ease;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.5s ease;
}

body.night-mode .error-message {
  background: #c62828;
}

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

/* Mobile Specific Adjustments */
@media (max-width: 480px) {
  body {
    padding: 15px 10px 30px;
    align-items: flex-start;
  }

  .cat-container {
    height: 80px;
    margin-bottom: 15px;
  }

  .cat {
    width: 100px;
    height: 100px;
    margin-top: -15px;
  }

  .cat-body {
    width: 65px;
    height: 52px;
    left: 17px;
  }

  .cat-head {
    width: 52px;
    height: 46px;
    top: 15px;
    left: 24px;
  }

  .ear {
    border-left-width: 13px;
    border-right-width: 13px;
    border-bottom-width: 23px;
    top: -10px;
  }

  .ear-inner {
    border-left-width: 6px;
    border-right-width: 6px;
    border-bottom-width: 11px;
    top: 5px;
    left: -6px;
  }

  .eye {
    width: 12px;
    height: 14px;
    top: 20px;
  }

  .eye.left {
    left: 13px;
  }

  .eye.right {
    right: 13px;
  }

  .nose {
    border-left-width: 5px;
    border-right-width: 5px;
    border-top-width: 4px;
    top: 30px;
    left: 21px;
  }

  .mouth {
    width: 20px;
    height: 10px;
    top: 33px;
    left: 16px;
  }

  .whisker {
    width: 26px;
    top: 28px;
  }

  .whisker.left-1,
  .whisker.left-2 {
    left: -22px;
  }

  .whisker.right-1,
  .whisker.right-2 {
    right: -22px;
  }

  .tail {
    width: 40px;
    height: 40px;
    border-width: 10px;
    bottom: 6px;
    right: -13px;
  }

  .form-container {
    padding: 25px 20px;
  }

  .form-header h2 {
    font-size: 22px;
  }

  .form-header p {
    font-size: 12px;
  }

  .form-group input {
    padding: 16px;
    padding-right: 50px;
    font-size: 16px;
  }

  .password-toggle {
    right: 16px;
    width: 28px;
    height: 28px;
  }

  .eye-icon {
    width: 22px;
    height: 22px;
  }

  .submit-btn {
    padding: 18px;
    font-size: 16px;
  }

  .sleeping-z {
    font-size: 16px;
  }

  .sleeping-z:nth-child(2) {
    font-size: 12px;
  }

  .sleeping-z:nth-child(3) {
    font-size: 10px;
  }
}

/* Very Small Screens */
@media (max-width: 360px) {
  .form-container {
    padding: 20px 15px;
  }

  .form-header h2 {
    font-size: 20px;
  }

  .toggle-btn {
    padding: 10px;
    font-size: 13px;
  }
}

/* Landscape Mode */
@media (max-height: 600px) and (orientation: landscape) {
  body {
    padding: 10px;
  }

  .cat-container {
    height: 60px;
    margin-bottom: 10px;
  }

  .cat {
    width: 80px;
    height: 80px;
    margin-top: -10px;
  }

  .form-container {
    padding: 20px;
  }

  .form-header {
    margin-bottom: 15px;
  }

  .form-header h2 {
    font-size: 20px;
    margin-bottom: 5px;
  }

  .form-group {
    margin-bottom: 12px;
  }

  .submit-btn {
    padding: 12px;
  }
}
