/* Import the same fonts from the main site */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&family=Lato:wght@400;700&display=swap');

/* Use the EXACT same theme variables for consistency */
:root {
  --primary-blue: #345995;
  --accent-yellow: #eac435;
  --hover-yellow: #ffdd57;
  --light-bg: #f5f5f5;
  --text-dark: #222;
  --text-light: #fff;
  --card-bg: #ffffff;
  --border-color: #000;
  --border-radius-main: 2rem;
  --shadow-bold: 5px 5px 0px var(--border-color);
  --success-color: #28a745;
  --error-color: #dc3545;
}

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

body {
  background-color: var(--light-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 100vh;
  font-family: 'Lato', sans-serif;
  color: var(--text-dark);
}

h1 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary-blue);
}

p {
  font-size: 1rem;
  line-height: 1.4;
}

/* ===== UPDATED LOGO STYLES ===== */
.home-link {
  display: flex; /* Use flexbox to easily center the image */
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  background-color: var(--primary-blue); /* Use the theme's dark blue for contrast */
  width: 100px; /* Give the circle a fixed size */
  height: 100px;
  border-radius: 50%; /* This makes it a circle */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* Add a subtle shadow to lift it off the page */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.home-link:hover {
  transform: scale(1.05) translateY(-5px); /* A more refined hover effect */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.home-link img {
  height: 70px; /* Make the logo image slightly smaller than the circle */
  width: auto;  /* Maintain aspect ratio */
  /* The transition is now on the parent .home-link, so we don't need it here */
}


.container {
  background: var(--card-bg);
  border: 3px solid var(--border-color);
  border-radius: var(--border-radius-main);
  box-shadow: var(--shadow-bold);
  position: relative;
  overflow: hidden;
  width: 768px;
  max-width: 95%;
  min-height: 500px;
}

.form-container {
  position: absolute;
  top: 0;
  height: 100%;
  transition: all 0.6s ease-in-out;
}

form {
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0 40px;
  height: 100%;
  text-align: center;
}

.input-box {
  width: 100%;
  margin: 8px 0;
  position: relative;
}

.input-box input {
  background: #f0f0f0;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-main);
  padding: 12px 15px;
  width: 100%;
  font-size: 1rem;
  outline-color: var(--accent-yellow);
}

.input-box i {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-blue);
}

a.forgot {
  color: var(--primary-blue);
  font-size: 0.9rem;
  text-decoration: none;
  margin: 10px 0;
}
a.forgot:hover { text-decoration: underline; }


/* Buttons styled to match the main site */
.btn, .ghost {
  border-radius: 50px;
  border: 3px solid var(--border-color);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 45px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 80ms ease-in, box-shadow 0.3s ease;
}

.btn {
  background-color: var(--accent-yellow);
  color: var(--text-dark);
  margin-top: 1rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0,0,0,0.15);
}

.ghost {
  background-color: transparent;
  border-color: var(--text-light);
  color: var(--text-light);
}

/* OVERLAY STYLING */
.overlay-container {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  overflow: hidden;
  transition: transform 0.6s ease-in-out;
  z-index: 100;
}

.overlay {
  background: var(--primary-blue);
  color: var(--text-light);
  position: relative;
  left: -100%;
  height: 100%;
  width: 200%;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
}
.overlay h1 { color: var(--text-light); }

.overlay-panel {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0 40px;
  text-align: center;
  top: 0;
  height: 100%;
  width: 50%;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
}
.overlay-left { transform: translateX(-20%); }
.overlay-right { right: 0; transform: translateX(0); }

/* SLIDING ANIMATION LOGIC */
.sign-in-container { left: 0; width: 50%; z-index: 2; }
.sign-up-container { left: 0; width: 50%; opacity: 0; z-index: 1; }
.container.right-panel-active .sign-in-container { transform: translateX(100%); }
.container.right-panel-active .sign-up-container { transform: translateX(100%); opacity: 1; z-index: 5; animation: show 0.6s; }
@keyframes show { 0%, 49.99% { opacity: 0; z-index: 1; } 50%, 100% { opacity: 1; z-index: 5; } }
.container.right-panel-active .overlay-container { transform: translateX(-100%); }
.container.right-panel-active .overlay { transform: translateX(50%); }
.container.right-panel-active .overlay-left { transform: translateX(0); }
.container.right-panel-active .overlay-right { transform: translateX(20%); }


/* NEW: FORM MESSAGE & LOADER STYLES */
.form-message {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  display: none; /* Hidden by default */
}
.form-message.error {
  display: block;
  background-color: #f8d7da;
  color: var(--error-color);
  border: 1px solid var(--error-color);
}
.form-message.success {
  display: block;
  background-color: #d4edda;
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

.btn.loading {
  position: relative;
  color: transparent; /* Hide button text */
  pointer-events: none;
}
.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -12px;
  margin-left: -12px;
  width: 24px;
  height: 24px;
  border: 3px solid var(--text-dark);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* NEW: SMARTER RESPONSIVE DESIGN */
.mobile-switch { display: none; } /* Hide on desktop */

@media (max-width: 768px) {
  .home-link { margin-bottom: 1rem; }
  .home-link img { height: 60px; }
  .container { min-height: 0; height: auto; padding: 2rem 0; box-shadow: none; border: none; width: 100%;}
  .overlay-container { display: none; }
  .sign-in-container, .sign-up-container {
    width: 100%;
    position: static;
    transform: none !important;
    opacity: 1;
  }
  .sign-up-container { display: none; /* Initially hide sign-up on mobile */ }

  /* Logic to show the right form */
  .container.show-signup .sign-in-container { display: none; }
  .container.show-signup .sign-up-container { display: block; }
  
  .mobile-switch { display: block; margin-top: 1.5rem; }
  .mobile-switch a { color: var(--primary-blue); font-weight: bold; }
}

