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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

.container {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wrapper {
  --input-focus: #4f46e5;
  --font-color: #374151;
  --font-color-sub: #6b7280;
  --bg-color: #ffffff;
  --bg-color-alt: #4f46e5;
  --main-color: #4b5563;

  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  width: 100vw;
  max-width: 350px;
}

.card-switch {
  position: relative;
}

.switch {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 40px;
}

.card-side::before {
  position: absolute;
  content: 'Log in';
  left: -70px;
  top: 10px;
  width: 100px;
  text-decoration: underline;
  color: var(--font-color);
  font-weight: 600;
}

.card-side::after {
  position: absolute;
  content: 'Sign up';
  left: 70px;
  top: 10px;
  width: 100px;
  text-decoration: none;
  color: var(--font-color);
  font-weight: 600;
}

.toggle {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: relative;
  width: 50px;
  height: 23px;
  background-color: var(--bg-color);
  border-radius: 50px;
  border: 2px solid var(--main-color);
  cursor: pointer;
  transition: 0.3s;
}

.slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: -1px;
  bottom: -1.5px;
  background-color: var(--bg-color);
  border: 2px solid var(--main-color);
  border-radius: 50%;
  transition: 0.3s;
}

.toggle:checked + .slider {
  background-color: var(--input-focus);
  border-color: var(--input-focus);
}

.toggle:checked + .slider:before {
  transform: translateX(28.5px);
  background-color: white;
  border-color: var(--input-focus);
}

.toggle:checked ~ .card-side::before {
  text-decoration: none;
}

.toggle:checked ~ .card-side::after {
  text-decoration: underline;
}

/* Flip card layout */
.flip-card__inner {
  width: 320px;
  height: 350px;
  background-color: transparent;
  perspective: 1000px;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.toggle:checked ~ .flip-card__inner {
  transform: rotateY(180deg);
}

.flip-card__front,
.flip-card__back {
  position: absolute;
  width: 100%;
  padding: 30px 20px;
  gap: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: white;
  
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  backface-visibility: hidden;
  
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.flip-card__front {
  animation: fadeIn 0.6s ease-in-out;
}

.flip-card__back {
  transform: rotateY(180deg);
}

.flip-card__form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.title {
  font-size: 26px;
  font-weight: 700;
  color: var(--font-color);
  text-align: center;
}

.flip-card__input {
  width: 100%;
  height: 45px;
  padding: 0 15px;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  background-color: var(--bg-color);
  font-size: 15px;
  font-weight: 500;
  color: var(--font-color);
  transition: all 0.3s ease;
}

.flip-card__input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.flip-card__input::placeholder {
  color: var(--font-color-sub);
}

.flip-card__btn {
  width: 140px;
  height: 45px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--input-focus) 0%, #6366f1 100%);
  font-size: 16px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.flip-card__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.flip-card__btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.forgot-password {
  font-size: 14px;
  color: var(--input-focus);
  text-decoration: none;
  margin-top: 5px;
}

.forgot-password:hover {
  text-decoration: underline;
}

/* Checkbox */
.checkbox-container {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--font-color);
  cursor: pointer;
  position: relative;
  padding-left: 25px;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
}

.checkmark {
  position: absolute;
  left: 0;
  top: 0;
  height: 18px;
  width: 18px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  background-color: white;
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--input-focus);
  border-color: var(--input-focus);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Responsive */
@media (max-width: 480px) {
  .wrapper {
    max-width: 100%;
    padding: 0 15px;
  }

  .flip-card__inner {
    height: 380px;
  }

  .title {
    font-size: 22px;
  }
}



@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/*.close-btn {*/
/*  position: absolute;*/
/*  top: 20px;*/
/*  right: 30px;*/
/*  font-size: 24px;*/
/*  font-weight: bold;*/
/*  color: #333;*/
/*  cursor: pointer;*/
/*  z-index: 1000;*/
/*  background: #eee;*/
/*  border: none; /* Remove default button border 
  border-radius: 50%;
  width: 30px;
  height: 30px;
  text-align: center;
  line-height: 28px; /* Slightly adjusted for better centering 
  transition: all 0.3s ease; /* Enhanced transition for all properties 
  display: flex; /* Better centering method 
  align-items: center;
  justify-content: center;
  outline: none; /* Remove focus outline, will add custom one 
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow 
  animation: fadeIn 0.4s ease-out; /* Apply fadeIn animation on load 
}

.close-btn:hover {
  background: #ff4757; /* Red background on hover 
  color: white;
  transform: scale(1.05); /* Slight scale effect 
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Enhanced shadow on hover 
}
*/

.close-btn:active {
  transform: scale(0.95); /* Press effect */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.close-btn:focus {
  outline: 2px solid #007bff; /* Custom focus outline */
  outline-offset: 2px;
}

/* Alternative modern style - uncomment if preferred */

.close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 18px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-btn:hover {
  background: rgba(255, 71, 87, 0.1);
  color: #ff4757;
  border-color: #ff4757;
  transform: translateY(-1px);
}
