/* =======================
   Reset & Base Styles
========================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  font-family: "Inter", sans-serif;
  height: 100vh;
  overflow: hidden; /* Prevent page scroll */
}

/* =======================
   Layout Container
========================== */

.register-container {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* ================================
   Global Input Font Styling
=================================== */

input[type="text"],
input[type="email"],
input[type="password"] {
  font-size: 1rem;
  color: #1d1d1d;
  font-family: "Inter", sans-serif;
}

/* =======================
   Left: Image Section
========================== */

.register-image-side {
  flex: 1.2; /* Takes up 60% of screen */
  background-image: url("../images/Landing\ Page\ Chuch\ Image.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #fafcf5ff; /* fallback background */
}

/* =======================
   Right: Form Section
========================== */

.register-form-side {
  flex: 0.8; /* Takes up 40% of screen */
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.form-content {
  width: 100%;
  max-width: 600px;
}

/* =======================
   Logo
========================== */

.form-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.form-logo img {
  width: 65px;
  height: auto;
  margin-right: 0.5rem;
}

.form-logo span {
  font-size: 1.5rem;
  font-weight: 600;
}

.logo-text {
  font-family: "Fondamento", cursive;
  font-size: 2rem;
  color: #010404;
  line-height: 1;
  margin-left: -18px;
  padding: 0;
}

/* =======================
   Titles
========================== */

h2 {
  text-align: left;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-subtitle {
  text-align: left;
  font-weight: 300;
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 2rem;
}

/* =======================
   Form Layout
========================== */

/* Row wrapper (first name + last name) */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap; /* Mobile friendly stacking */
}

/* Individual form group (label + input) */
.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 0.8rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 400;
  margin-bottom: 0.3rem;
}

/* Dropdown and Date styles */
.form-group select,
.form-group input[type="date"] {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #b6c1a3;
  font-size: 0.9rem;
  outline: none;
  background-color: #fff;
  color: #333;
}

/* Input box style */
.form-group input {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #b6c1a3;
  font-size: 0.9rem;
  outline: none;
}

/* ===========================
   Placeholder Text Styling
=========================== */
input::placeholder,
textarea::placeholder {
  font-size: 0.95rem;
  color: #999;
  opacity: 1;
  font-family: "Inter", sans-serif;
}

/* Vendor prefixes for full browser support */
::-webkit-input-placeholder {
  font-size: 0.95rem;
  color: #999;
  opacity: 1;
  font-family: "Inter", sans-serif;
}
:-ms-input-placeholder {
  font-size: 0.95rem;
  color: #999;
  font-family: "Inter", sans-serif;
}
::-moz-placeholder {
  font-size: 0.95rem;
  color: #999;
  opacity: 1;
  font-family: "Inter", sans-serif;
}

/* =====================================
   Password Field Styling (Shared)
===================================== */

/* Password Eye Icon - consistent small size & alignment */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

/* Input must reserve space for the icon */
.password-wrapper input {
  width: 100%;
  padding-right: 2.4rem !important; /* consistent spacing for icon */
  box-sizing: border-box;
}

/* Eye icon — consistent across login & register */
.toggle-password {
  position: absolute;
  right: 0.8rem; /* same as login */
  top: 50%;
  transform: translateY(-50%);
  width: 12px; /* same size as login */
  height: 12px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s ease;
  z-index: 3; /* ensures it overlays input, never shifts it */
}

.toggle-password:hover {
  opacity: 1;
}

/* =====================================
   Password Strength Meter (Register Only)
===================================== */
.password-strength {
  margin-top: 0.4rem;
  height: 6px;
  border-radius: 3px;
  background-color: #ddd;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

.password-strength .strength-bar {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
  background-color: red;
  border-radius: 3px;
}

/* Color states */
.strength-weak .strength-bar {
  width: 33%;
  background-color: #e74c3c;
}

.strength-medium .strength-bar {
  width: 66%;
  background-color: #f1c40f;
}

.strength-strong .strength-bar {
  width: 100%;
  background-color: #2ecc71;
}

/* Styles for JS-generated password validation (matches main.js setup) */
.password-feedback {
  opacity: 0;
  visibility: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: absolute;
  top: 40px; /* Correct positioning BELOW the field */
  right: 0; /* stays aligned to input edge */
  max-width: 280px;
  font-size: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  background: #fff;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 10;
}

.password-feedback.active {
  opacity: 1;
  visibility: visible;
}

.password-feedback li {
  display: inline-block;
  margin: 0;
  padding: 0;
}

.strength-bar {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: #ddd;
  margin-bottom: 0.4rem;
  transition: width 0.3s, background 0.3s;
}

.password-criteria {
  list-style: none;
  padding-left: 0;
  margin: 0.3rem 0 0;
}

.password-criteria li {
  color: #888;
  margin-bottom: 0.2rem;
}

.confirm-message {
  display: block;
  color: #e74c3c;
  font-size: 10px;
  margin-top: 4px;
}

/* =====================================
   Password Validation List (Register Only)
===================================== */
.password-requirements {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  list-style: none;
  padding-left: 0;
}

.password-requirements li {
  color: #777;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
}

.password-requirements li.valid {
  color: #2ecc71;
}

.password-requirements li::before {
  content: "•";
  color: #ccc;
  display: inline-block;
  width: 1em;
  margin-right: 4px;
}

.password-requirements li.valid::before {
  content: "✔";
  color: #2ecc71;
}

/* ===============================
   Password Feedback Popup
================================= */
.password-feedback.active {
  opacity: 1;
  visibility: visible;
}

.password-strength-bar {
  width: 40px;
  height: 6px;
  border-radius: 4px;
  background: #e74c3c;
  transition: width 0.3s, background 0.3s;
}

.password-criteria {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.password-criteria span {
  font-size: 10px;
  color: #666;
}

/* =======================
   Signup Button (Submit)
========================== */

.signup-btn {
  width: 100%;
  padding: 0.75rem;
  background-color: #b6c1a3;
  color: white;
  font-size: 1rem;
  border: none;
  border-radius: 999px; /* fully rounded */
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.3s ease;
}

.signup-btn:hover {
  background-color: rgba(204, 218, 165, 0.864);
}

/* === Disabled Button State === */
.signup-btn.btn-disabled {
  opacity: 0.7;
  pointer-events: none;
  cursor: not-allowed;
  transition: opacity 0.3s ease;
}

/* === Loading Spinner inside button === */
.signup-btn .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid currentColor; /* Uses the button text color */
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* =======================
   Redirect Text (below button)
========================== */

.redirect-text {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #666;
}

.redirect-text a {
  color: #82020b;
  text-decoration: none;
  font-weight: 500;
}
