/* 
  forms.css — Unified Form Styling for VETS Coin
  Created: 2025-04-28
  Updated: 2025-04-30 (Merged input styles, dark mode support)
  Author: Atlas (for Sir. Mark)
*/

/* ✅ Base Inputs */
form input,
form select,
form textarea {
  width: 100%;
  padding: 12px 18px;
  font-size: 1rem;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  margin-bottom: 1.25rem;
  background-color: #fff;
  color: var(--color-text);
  box-sizing: border-box;
  line-height: 1.2;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode form input,
body.dark-mode form select,
body.dark-mode form textarea {
  background-color: #111;
  color: #eee;
  border: 1px solid var(--color-border-dark);
}

body.dark-mode form input::placeholder {
  color: #888;
}

/* ✅ Labels */
form label {
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
  font-size: 0.95rem;
}

/* ✅ Password toggle */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 60px;
}

.toggle-password {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1.2rem;
  z-index: 2;
  color: #aaa;
  line-height: 1;
}

body.dark-mode .toggle-password {
  color: #ccc;
}

.toggle-password:hover {
  color: var(--color-accent);
}

/* ✅ Strength meter */
.strength-meter {
  height: 6px;
  border-radius: 3px;
  background: #ccc;
  margin-top: 4px;
}

body.dark-mode .strength-meter {
  background: #444;
}

.strength-meter[data-strength="1"] { background: red; }
.strength-meter[data-strength="2"] { background: orange; }
.strength-meter[data-strength="3"] { background: yellowgreen; }
.strength-meter[data-strength="4"] { background: green; }

.strength-tooltip {
  font-size: 0.85rem;
  color: #888;
  margin-top: 4px;
}

body.dark-mode .strength-tooltip {
  color: #ccc;
}

/* ✅ Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: bold;
  background-color: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s ease;
}

.btn:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #444;
}

.btn-secondary:hover {
  background-color: #666;
}

.btn-xs {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}

/* ✅ Form footer links */
.form-footer {
  text-align: center;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.form-footer p {
  color: var(--color-footer-dark);
  text-align: center;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.form-footer a {
  color: var(--color-accent);
  text-decoration: none;
}

.form-footer a:hover {
  text-decoration: underline;
}

/* ✅ Prevent Chrome autofill from overriding dark mode styling */
input:-webkit-autofill,
input:-webkit-autofill:focus {
  background-color: #111 !important;
  color: #000000 !important;
  transition: background-color 9999s ease-out, color 9999s ease-out;
  -webkit-text-fill-color: #000000 !important;
}

/* ✅ Prevent white background from appearing in dark mode inputs on focus */
body.dark-mode form input:focus,
body.dark-mode form input:not(:placeholder-shown) {
  background-color: #201a1a !important;
  color: #ffffff !important;
}

body:not(.dark-mode) input:focus,
body:not(.dark-mode) textarea:focus,
body:not(.dark-mode) select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2); /* lighter blue for light mode */
}
