/*
Theme Name: Neo Bank
Author: Pavel

License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

*/

/* Базовые стили, токены и компоненты — в src/tailwind.css (собирается в assets/css/tailwind.css).
   Здесь — только оформление форм Profile Builder в модалке входа. */

#auth-modal .wppb-user-forms {
  width: 100%;
  margin: 0;
  color: rgb(var(--fg));
}

#auth-modal .wppb-user-forms ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Каждое поле резервирует под собой одну строку для ошибки —
   при появлении ошибок форма не «прыгает». */
#auth-modal .wppb-user-forms .wppb-form-field,
#auth-modal .wppb-user-forms .login-username,
#auth-modal .wppb-user-forms .login-password {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0 0 1.625rem;
}

#auth-modal .wppb-user-forms .login-remember {
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0;
}

#auth-modal .wppb-user-forms .wppb-form-field > label,
#auth-modal .wppb-user-forms .wppb-password-subfield > label,
#auth-modal .wppb-user-forms .login-username > label,
#auth-modal .wppb-user-forms .login-password > label {
  display: block;
  float: none !important;
  width: 100% !important;
  min-height: 0;
  margin-bottom: 0.375rem;
  color: rgb(var(--slate-400));
  font-size: 0.75rem;
  line-height: 1.5;
}

#auth-modal .wppb-user-forms input[type="text"],
#auth-modal .wppb-user-forms input[type="email"],
#auth-modal .wppb-user-forms input[type="password"],
#auth-modal .wppb-user-forms select,
#auth-modal .wppb-user-forms textarea {
  display: block;
  float: none !important;
  width: 100%;
  max-width: 100%;
  min-height: 3.125rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgb(var(--line));
  border-radius: 0.75rem;
  background: rgb(var(--inset));
  color: rgb(var(--fg));
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

#auth-modal .wppb-user-forms input[type="text"]:focus,
#auth-modal .wppb-user-forms input[type="email"]:focus,
#auth-modal .wppb-user-forms input[type="password"]:focus,
#auth-modal .wppb-user-forms select:focus,
#auth-modal .wppb-user-forms textarea:focus {
  border-color: rgb(var(--primary));
  outline: none;
  box-shadow: 0 0 0 3px rgb(var(--primary) / 0.18);
}

#auth-modal .wppb-user-forms .wppb-password-field-container input[type="password"],
#auth-modal .wppb-user-forms .wppb-password-field-container input[type="text"] {
  float: none !important;
  width: 100% !important;
}

#auth-modal .wppb-user-forms .wppb-password-field-container {
  display: block;
  float: none !important;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

/* ---------- Ошибка под полем ---------- */
#auth-modal .wppb-user-forms .wppb-form-error {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.25rem;
  display: flex !important;
  align-items: center;
  gap: 0.375rem;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: rgb(var(--danger)) !important;
  font-size: 0.75rem !important;
  font-style: normal;
  font-weight: 500;
  line-height: 1.125rem !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: neo-error-in 180ms var(--ease);
}

#auth-modal .wppb-user-forms .wppb-form-error::before {
  content: '';
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

#auth-modal .wppb-user-forms .wppb-description-delimiter {
  display: none;
}

#auth-modal .wppb-user-forms .wppb-field-error {
  margin: 0 !important;
  padding: 0 0 1.625rem !important;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
}

/* Иконки-карандаши Profile Builder в подписях не нужны: ошибка показывается текстом под полем */
#auth-modal .wppb-user-forms label img {
  display: none !important;
}

#auth-modal .wppb-user-forms .wppb-field-error > input,
#auth-modal .wppb-user-forms .wppb-field-error > select,
#auth-modal .wppb-user-forms .wppb-field-error > textarea,
#auth-modal .wppb-user-forms .wppb-field-error .wppb-password-field-container input {
  border-color: rgb(var(--danger) / 0.55);
  background: rgb(var(--danger) / 0.03);
}

#auth-modal .wppb-user-forms .wppb-field-error > input:focus,
#auth-modal .wppb-user-forms .wppb-field-error .wppb-password-field-container input:focus {
  border-color: rgb(var(--danger));
  box-shadow: 0 0 0 3px rgb(var(--danger) / 0.15);
}

/* ---------- Общее сообщение над формой (лежит вне .wppb-user-forms) ---------- */
#auth-modal #wppb_form_general_message,
#auth-modal .wppb-error,
#auth-modal .wppb-warning,
#auth-modal .wppb-success,
#auth-modal .wppb-notice,
#auth-modal .wppb-alert,
#auth-modal .alert {
  box-sizing: border-box;
  display: flex !important;
  align-items: flex-start;
  gap: 0.625rem;
  width: 100%;
  margin: 0 0 1.25rem !important;
  padding: 0.75rem 0.875rem !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-md) !important;
  box-shadow: none !important;
  font-size: 0.875rem !important;
  font-weight: 500;
  line-height: 1.45 !important;
  text-align: left;
  animation: neo-error-in 200ms var(--ease);
}

#auth-modal #wppb_form_general_message::before,
#auth-modal .wppb-error::before,
#auth-modal .wppb-warning::before,
#auth-modal .wppb-success::before,
#auth-modal .wppb-notice::before,
#auth-modal .wppb-alert::before,
#auth-modal .alert::before {
  content: '';
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.0625rem;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

#auth-modal .wppb-error,
#auth-modal #wppb_form_general_message.wppb-error,
#auth-modal #wppb_form_general_message.alert:not(.wppb-success) {
  border-color: rgb(var(--danger) / 0.2) !important;
  background: rgb(var(--danger) / 0.06) !important;
  color: rgb(var(--red-300)) !important;
}

#auth-modal .wppb-success,
#auth-modal #wppb_form_general_message.wppb-success,
#auth-modal #wppb_form_general_message.alert.wppb-success {
  border-color: rgb(var(--success) / 0.22) !important;
  background: rgb(var(--success) / 0.06) !important;
  color: rgb(var(--emerald-300)) !important;
}

#auth-modal .wppb-notice,
#auth-modal .wppb-alert,
#auth-modal .alert:not(.wppb-error):not(.wppb-success) {
  border-color: rgb(var(--primary) / 0.22) !important;
  background: rgb(var(--primary) / 0.06) !important;
  color: rgb(var(--blue-300)) !important;
}

#auth-modal .wppb-warning {
  border-color: rgb(var(--warning) / 0.28) !important;
  background: rgb(var(--warning) / 0.07) !important;
  color: rgb(var(--amber-200)) !important;
}

#auth-modal .wppb-error a,
#auth-modal .wppb-warning a,
#auth-modal .wppb-success a,
#auth-modal .wppb-notice a,
#auth-modal .wppb-alert a,
#auth-modal .alert a {
  color: inherit !important;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@keyframes neo-error-in {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: none; }
}

#auth-modal .wppb-user-forms .wppb-send-credentials-checkbox {
  display: none;
}

#auth-modal .wppb-user-forms .login-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgb(var(--slate-400));
  font-size: 0.75rem;
}

#auth-modal .wppb-user-forms .login-remember input {
  margin: 0;
}

#auth-modal .wppb-user-forms .login-remember label {
  float: none !important;
  width: auto !important;
  margin: 0;
  color: inherit;
  cursor: pointer;
}

#auth-modal .wppb-user-forms .form-submit,
#auth-modal .wppb-user-forms .login-submit {
  margin: 1.5rem 0 0;
  padding: 0;
}

#auth-modal .wppb-user-forms input[type="submit"],
#auth-modal .wppb-user-forms #wppb-submit,
#auth-modal .wppb-user-forms #register {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.875rem 1rem;
  border: 0;
  border-radius: 0.75rem;
  background: rgb(var(--primary));
  color: rgb(var(--on-accent));
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: background-color 200ms var(--ease), transform 200ms var(--ease);
}

#auth-modal .wppb-user-forms input[type="submit"]:hover,
#auth-modal .wppb-user-forms #wppb-submit:hover,
#auth-modal .wppb-user-forms #register:hover {
  background: #1d4ed8;
}

#auth-modal .wppb-user-forms #wppb_register_pre_form_message {
  margin: 0 0 1rem;
  color: rgb(var(--amber-400));
  font-size: 0.75rem;
  line-height: 1.5;
}

#auth-modal #wppb-login-wrap .login-register-lost-password {
  margin: 1rem 0 0;
  color: rgb(var(--slate-400));
  font-size: 0.75rem;
  text-align: center;
}

#auth-modal #wppb-login-wrap .login-register-lost-password a {
  color: rgb(var(--blue-400));
  text-decoration: none;
}

#auth-modal #wppb-login-wrap .login-register-lost-password a:hover {
  color: rgb(var(--blue-300));
}
