.password-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.password-dialog {
  border-radius: 16px;
  padding: 30px 24px;
  width: 340px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
}

.password-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}

.password-form label {
  display: block;
  font-size: 14px;
  margin-bottom: 12px;
}

.required {
  color: red;
  margin-left: 4px;
}

.password-input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  margin-top: 4px;
  border-radius: 8px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.password-input.error {
  border-color: red;
}

.input-error {
  color: red;
  font-size: 12px;
  height: 14px;
  margin-top: 4px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.password-action {
  padding: 12px 16px;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  background-color: #007bff;
  color: white;
  cursor: pointer;
  flex: 1;
  margin: 0 4px;
  transition: background-color 0.2s ease;
}

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

.cancel-btn {
  background-color: #aaa;
}

.cancel-btn:hover {
  background-color: #888;
}

.form-status {
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
  color: red;
}

@media (max-width: 767px) and (pointer: coarse) and (hover: none) {
    /* Set base font size for consistency (optional, only if not already set) */
    html {
        font-size: 16px; /* Adjust to 14px for smaller scaling if needed */
    }

    .password-dialog {
        width: 90vw; /* Unchanged, good for mobile */
        max-width: 100%; /* Unchanged */
        padding: 1.5rem 0.75rem; /* ~24px 12px, reduced from 40px 20px */
        border-radius: 0.75rem; /* ~12px, reduced from 20px */
        font-size: 1rem; /* ~16px, readable */
    }

    .password-title {
        font-size: 1.5rem; /* ~24px, prominent but not 64px */
        margin-bottom: 1rem; /* ~16px, reduced from 30px */
    }

    .password-form label {
        font-size: 1rem; /* ~16px, readable */
        margin-bottom: 0.75rem; /* ~12px, reduced from 20px */
    }

    .required {
        font-size: 1rem; /* ~16px, matches labels */
    }

    .password-input {
        font-size: 1rem; /* ~16px, readable */
        padding: 0.75rem; /* ~12px, reduced from 24px */
        border-radius: 0.5rem; /* ~8px, reduced from 16px */
    }

    .input-error {
        font-size: 0.875rem; /* ~14px, slightly smaller for errors */
        height: auto; /* Unchanged */
    }

    .form-actions {
        flex-direction: column; /* Unchanged, good for mobile */
        gap: 0.75rem; /* ~12px, reduced from 20px */
        margin-top: 1.5rem; /* ~24px, reduced from 40px */
    }

    .password-action {
        font-size: 1rem; /* ~16px, readable */
        padding: 0.75rem; /* ~12px, reduced but touch-friendly */
        width: 100%; /* Unchanged, full-width is good */
        margin: 0; /* Unchanged */
    }

    .form-status {
        font-size: 0.875rem; /* ~14px, readable */
        margin-top: 1rem; /* ~16px, reduced from 30px */
    }
}