/* ---------------------------------------
   1. Variables (adjust as needed)
----------------------------------------*/
:root {
  --primary-color: #1976d2;         /* MUI blue 700 */
  --primary-color-hover: #1565c0;   /* Slightly darker */
  --primary-color-light: #63a4ff;   /* Light blue for focus */
  --error-color: #e53935;           /* Red accent */
  --input-text-color: #212121;      /* dark gray */
  --label-color: #757575;           /* medium gray */
  --background-color: #fff;         /* white background */
  --border-color: rgba(0, 0, 0, 0.42); /* Material‐style underline */
}

/* ---------------------------------------
   2. Container for each input + label
----------------------------------------*/
.material-form-group {
  position: relative;
  margin-bottom: 1.5rem; /* spacing below each field */
  width: 100%;
}

/* ---------------------------------------
   3. The input itself
----------------------------------------*/
.material-input {
  font-size: 1rem; /* 16px */
  color: var(--input-text-color);
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-color);
  padding: 0.25rem 0; /* top/bottom padding only */
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease;
}

/* 
   When input is empty (placeholder shown) AND not focused, we keep label inside.
   When input has content OR is focused, we’ll float the label up.
*/
.material-input:focus {
  border-bottom: 2px solid var(--primary-color-light);
}

/* ---------------------------------------
   4. The floating label
----------------------------------------*/
.material-label {
  position: absolute;
  left: 0;
  top: 0.25rem; /* aligns with padding-top of input */
  font-size: 1rem;
  color: var(--label-color);
  pointer-events: none;
  transform-origin: left top;
  transition:
    transform 0.2s ease,
    font-size 0.2s ease,
    color 0.2s ease;
}

.material-input:not(.enable-float):focus + .material-label,
.material-input:not(.enable-float):not(:placeholder-shown) + .material-label {
  visibility: hidden;
}

/* Add class enable-float with material-input class to have floating label
   If input is focused OR input is not “empty”, shrink and move label 
*/
.material-input.enable-float:focus + .material-label,
.material-input.enable-float:not(:placeholder-shown) + .material-label {
  transform: translateY(-1.2rem) scale(0.75);
  color: var(--primary-color);
}

/* ---------------------------------------
   5. Error message styling
----------------------------------------*/
.form-error {
  color: var(--error-color);
  font-size: 0.875rem;  /* 14px */
  margin-top: 0.25rem;
}

/* ---------------------------------------
   6. Material‐style button
----------------------------------------*/
.material-button {
  position: relative;
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  padding: 0.5rem 1.5rem;
  border: none;
  border-radius: 4px;
  overflow: hidden;         /* for ripple effect */
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0px 3px 1px -2px rgba(0,0,0,0.2),
              0px 2px 2px 0px rgba(0,0,0,0.14),
              0px 1px 5px 0px rgba(0,0,0,0.12);
}

/* Hover state */
.material-button:hover {
  background-color: var(--primary-color-hover);
  box-shadow: 0px 4px 5px -2px rgba(0,0,0,0.2),
              0px 7px 8px 0px rgba(0,0,0,0.14),
              0px 3px 14px 2px rgba(0,0,0,0.12);
}

/* Focus state */
.material-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.3);
}

/* Disabled state (optional) */
.material-button:disabled {
  background-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.26);
  box-shadow: none;
  cursor: default;
}

/* ---------------------------------------
   7. Ripple effect (using pseudo‐element)
   Lots of Material designs use JS to create ripples;
   here’s a pure‐CSS approximation using :after and keyframes.
----------------------------------------*/
.material-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 0.2s ease, transform 0.3s ease;
  pointer-events: none;
}

.material-button:active::after {
  width: 200px;  /* expand ripple */
  height: 200px;
  opacity: 0.2;
  transform: translate(-50%, -50%) scale(1);
  transition: none; /* instant start */
}