/* Font */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap");

/* Theme */
:root {
  --first-color: #520099;
  --page-bg: #ffffff;
  --text: #2b2b2b;
}

/* Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Outfit", sans-serif;
}
html,
body {
  height: 100%;
}
body {
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Stage */
.form-container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page-bg);
  overflow: hidden;
}

/* Home button */
.home-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  color: var(--first-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 500;
}
.home-btn .bx-arrow-back {
  font-size: 26px;
  transform: none;
}

/* Card */
.form-content {
  position: relative;
  z-index: 2;
  width: clamp(320px, 90vw, 440px);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.2);
  padding: 28px 28px 26px;
}

/* Panels (Login/Register) */
.panel {
  position: relative;
}
.panel.hidden {
  display: none;
}

/* Header: icons + title */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.header-row i {
  font-size: 26px;
  color: var(--first-color);
  cursor: pointer;
}

.form-title {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 600;
  color: var(--first-color);
  line-height: 1.2;
  margin-bottom: 24px;
}

/* Fade animation for header (icons + title) */
.fade-wrap {
  position: relative;
}
.fade-target {
  transition: opacity 0.28s ease;
}
.fade-out {
  opacity: 0;
}
.fade-in {
  opacity: 1;
}

/* Inputs */
.input-box {
  position: relative;
  margin: 18px 0;
}
.input-field {
  width: 100%;
  height: 48px;
  font-size: 16px;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  border-bottom: 1px solid var(--first-color);
  padding-top: 10px;
}
.input-field:focus,
.input-field:not(:placeholder-shown),
.input-field:-webkit-autofill {
  border-bottom: 2px solid var(--first-color);
}

/* Floating label */
.input-box label {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--first-color);
  font-weight: 500;
  transition: all 0.25s ease;
  pointer-events: none;
}
.input-field:focus ~ label,
.input-field:not(:placeholder-shown) ~ label,
.input-field:-webkit-autofill ~ label {
  top: -6%;
  transform: translateY(-15%);
  font-size: 14px;
}

/* Hide placeholder but keep it for :placeholder-shown */
.input-field::placeholder {
  color: transparent;
}
input:-webkit-autofill {
  -webkit-text-fill-color: inherit;
  transition: background-color 9999s;
}

/* Submit */
.input-submit {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 50px;
  background: var(--first-color);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
  transition: gap 0.25s ease;
}
.input-submit:hover {
  gap: 14px;
}
.bx-arrow-back {
  transform: rotate(180deg);
}

/* Links */
.form-bottom-links {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
}
.form-bottom-links a {
  color: var(--first-color);
  text-decoration: none;
  font-weight: 500;
}

/* Banners */
.success-banner,
.error-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}
.success-banner {
  background: #eaf7ea;
  color: #1e6d1e;
}
.error-banner {
  background: #ffe6e6;
  color: #8a1f1f;
}

/* Smooth fade transition */
.login-container,
.register-container {
  opacity: 0;
  transition: opacity 0.28s ease;
}

.fade-in {
  opacity: 1 !important;
}
.fade-out {
  opacity: 0 !important;
}

.hidden {
  display: none !important;
}

/* Ensure only the inactive panel is hidden */
.panel.hidden {
  display: none !important;
}

/* Make the active panel and its contents fully visible even if animations exist */
.panel:not(.hidden) {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.panel:not(.hidden) .fade-target {
  opacity: 1 !important;
  transform: none !important;
}

