/* Complete Profile Form Styling */
.complete-profile-form {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.complete-profile-form .messages {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: 4px;
}

.complete-profile-form .messages--warning {
  background-color: #e3f2fd;
  border-left: 4px solid #1976d2;
  color: #0d47a1;
}

/* Form item spacing and layout */
.complete-profile-form .form-item {
  margin-bottom: 1.5rem;
  clear: both;
}

.complete-profile-form .form-item:after {
  content: "";
  display: table;
  clear: both;
}

/* Label styling - consistent for all fields */
.complete-profile-form label,
.complete-profile-form .label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #333;
  font-size: 1rem;
}

/* Required field indicator */
.complete-profile-form .form-required,
.complete-profile-form .required-mark {
  color: #d32f2f;
  margin-left: 0.25rem;
}

/* Input fields - consistent styling */
.complete-profile-form input[type="text"],
.complete-profile-form input[type="email"],
.complete-profile-form input[type="date"],
.complete-profile-form input[type="tel"],
.complete-profile-form input[type="password"],
.complete-profile-form select,
.complete-profile-form textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

/* Focus states */
.complete-profile-form input:focus,
.complete-profile-form select:focus,
.complete-profile-form textarea:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

/* Field description text */
.complete-profile-form .description {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Disabled fields */
.complete-profile-form input[disabled],
.complete-profile-form select[disabled] {
  background-color: #f5f5f5;
  color: #666;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Checkbox styling */
.complete-profile-form input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.complete-profile-form .form-type-checkbox label {
  display: inline;
  font-weight: normal;
  margin-bottom: 0;
}

.complete-profile-form .form-type-checkbox {
  padding: 0.75rem 0;
}

/* Select dropdown arrow */
.complete-profile-form select {
  appearance: none;
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* Phone field with country code */
.complete-profile-form .intl-tel-input {
  width: 100%;
  display: block;
}

.complete-profile-form .intl-tel-input .form-control {
  width: 100%;
  padding-left: 60px;
}

/* Date field styling */
.complete-profile-form input[type="date"] {
  min-height: 45px;
}

/* Actions container */
.complete-profile-form .form-actions {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}

/* Submit button */
.complete-profile-form button[type="submit"],
.complete-profile-form .button--primary {
  background-color: #1976d2;
  color: white;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  min-width: 200px;
}

.complete-profile-form button[type="submit"]:hover,
.complete-profile-form .button--primary:hover {
  background-color: #1565c0;
}

.complete-profile-form button[type="submit"]:active {
  transform: translateY(1px);
}

/* Error messages */
.complete-profile-form .error,
.complete-profile-form .form-item--error-message {
  color: #d32f2f;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: block;
}

.complete-profile-form .form-item--error input,
.complete-profile-form .form-item--error select {
  border-color: #d32f2f;
}

/* Fieldset styling */
.complete-profile-form fieldset {
  border: 1px solid #ddd;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 4px;
}

.complete-profile-form legend {
  font-weight: 700;
  padding: 0 0.5rem;
  font-size: 1.1rem;
}

/* Field wrapper for complex fields */
.complete-profile-form .field--widget-telephone_default,
.complete-profile-form .field--widget-datetime_default,
.complete-profile-form .field--widget-options_select {
  margin-bottom: 1.5rem;
}

/* Ensure field labels are visible */
.complete-profile-form .field--widget-string_textfield > label,
.complete-profile-form .field--widget-telephone_default > label,
.complete-profile-form .field--widget-datetime_default > label,
.complete-profile-form .field--widget-options_select > label,
.complete-profile-form .field--widget-boolean_checkbox > label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #333;
}

/* Widget containers */
.complete-profile-form .field--widget-string_textfield,
.complete-profile-form .field--widget-telephone_default,
.complete-profile-form .field--widget-datetime_default,
.complete-profile-form .field--widget-options_select,
.complete-profile-form .field--widget-boolean_checkbox {
  margin-bottom: 1.5rem;
}

/* Make sure nested form elements don't get double margins */
.complete-profile-form .field--widget-string_textfield .form-item,
.complete-profile-form .field--widget-telephone_default .form-item,
.complete-profile-form .field--widget-datetime_default .form-item,
.complete-profile-form .field--widget-options_select .form-item {
  margin-bottom: 0;
}

/* Password section styling - UPDATED TO BLUE */
.complete-profile-form .password-fieldset {
  background-color: #e3f2fd;
  border: 2px solid #1976d2;
  margin-bottom: 2rem;
}

.complete-profile-form .password-fieldset legend {
  background-color: #1976d2;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
}

.complete-profile-form .password-policy-info {
  background-color: #f5f5f5;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
  font-size: 0.9rem;
  border-left: 4px solid #1976d2;
}

.complete-profile-form .password-policy-info strong {
  color: #0d47a1;
}

.complete-profile-form .password-policy-info ul {
  margin: 0.5rem 0 0 1.5rem;
  padding: 0;
}

.complete-profile-form .password-policy-info li {
  margin-bottom: 0.25rem;
  color: #424242;
}

/* Password field labels */
.complete-profile-form .password-fieldset label {
  color: #0d47a1;
  font-weight: 700;
}

/* Password strength indicator */
.complete-profile-form .password-strength {
  margin-top: 0.5rem;
}

.complete-profile-form .password-strength__meter {
  height: 6px;
  background-color: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}

.complete-profile-form .password-strength__indicator {
  height: 100%;
  transition: width 0.3s, background-color 0.3s;
}

.complete-profile-form .password-strength__indicator.is-weak {
  background-color: #d32f2f;
  width: 33%;
}

.complete-profile-form .password-strength__indicator.is-fair {
  background-color: #ff9800;
  width: 66%;
}

.complete-profile-form .password-strength__indicator.is-strong {
  background-color: #388e3c;
  width: 100%;
}

/* Password confirm wrapper */
.complete-profile-form .password-confirm-wrapper {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.complete-profile-form .password-confirm-wrapper .form-item {
  flex: 1;
  min-width: 250px;
}

/* Password match indicator */
.complete-profile-form .password-match-status {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.complete-profile-form .password-match-status.match {
  color: #388e3c;
}

.complete-profile-form .password-match-status.no-match {
  color: #d32f2f;
}

/* Responsive design */
@media (max-width: 768px) {
  .complete-profile-form {
    padding: 1rem;
  }

  .complete-profile-form button[type="submit"] {
    width: 100%;
  }

  .complete-profile-form .password-confirm-wrapper {
    flex-direction: column;
  }
}

/* Override any Gin theme styles that might interfere */
.complete-profile-form .form-element {
  width: 100%;
}

/* Fix for fields that might be hidden */
.complete-profile-form .field__item {
  display: block;
}

/* Ensure proper spacing for all field types */
.complete-profile-form > .field--widget-string_textfield,
.complete-profile-form > .field--widget-telephone_default,
.complete-profile-form > .field--widget-datetime_default,
.complete-profile-form > .field--widget-options_select,
.complete-profile-form > .field--widget-boolean_checkbox {
  clear: both;
  width: 100%;
}

/* Info message styling */
.complete-profile-form .messages--info {
  background-color: #e3f2fd;
  border-left: 4px solid #1976d2;
  color: #0d47a1;
}

/* Success message styling */
.complete-profile-form .messages--status {
  background-color: #e8f5e9;
  border-left: 4px solid #388e3c;
  color: #1b5e20;
}

/* Mobile Number Field Styling */
.complete-profile-form .field--widget-telephone_default > label,
.complete-profile-form label[for*="mobile"] {
  color: #d32f2f;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* Phone field container */
.complete-profile-form .field--widget-telephone_default,
.complete-profile-form .form-item-field-mobile-number-0-value {
  position: relative;
}

/* Phone input field */
.complete-profile-form input[type="tel"],
.complete-profile-form input[name*="mobile"] {
  width: 100%;
  padding: 0.75rem;
  padding-left: 60px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  color: #424242;
  box-sizing: border-box;
  transition: border-color 0.2s;
  background-color: #ffffff;
}

/* Flag icon container - positioned inside the input */
.complete-profile-form .field--widget-telephone_default .form-item:before,
.complete-profile-form .form-item-field-mobile-number-0-value:before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 22px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 1;
  pointer-events: none;
}

/* UAE Flag SVG - you can change this to any country flag */
.complete-profile-form .field--widget-telephone_default .form-item:before,
.complete-profile-form .form-item-field-mobile-number-0-value:before {
}

/* Focus state */
.complete-profile-form input[type="tel"]:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

/* Placeholder styling */
.complete-profile-form input[type="tel"]::placeholder {
  color: #9e9e9e;
  letter-spacing: 0.5px;
}

/* If using the phone field library already in your code */
.complete-profile-form .intl-tel-input {
  width: 100%;
  display: block;
}

.complete-profile-form .intl-tel-input .form-control,
.complete-profile-form .intl-tel-input input[type="tel"] {
  width: 100%;
  padding-left: 60px;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  color: #424242;
}

.complete-profile-form .intl-tel-input .selected-flag {
  padding: 0 8px 0 12px;
  background-color: transparent;
}

.complete-profile-form .intl-tel-input .iti__flag-container {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 12px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .complete-profile-form input[type="tel"] {
    font-size: 1rem;
  }
}

/* ==========================================
   DRUPAL ERROR MESSAGES - ADDITIONAL COVERAGE
   ========================================== */

/* Top-level Drupal error messages */
.complete-profile-form .messages.messages--error,
.complete-profile-form .messages.error {
  background-color: #ffebee;
  border-left: 4px solid #d32f2f;
  color: #c62828;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.complete-profile-form .messages.messages--error::before,
.complete-profile-form .messages.error::before {
  content: "⚠ ";
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

/* Field-level error messages */
.complete-profile-form .form-item.form-item--error .error,
.complete-profile-form .form-item.error .error,
.complete-profile-form .form-item .form-item--error-message,
.complete-profile-form .form-item .error-message {
  color: #d32f2f;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: block;
  background-color: #ffebee;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  border-left: 3px solid #d32f2f;
  font-weight: 500;
}

/* Error state for input fields */
.complete-profile-form .form-item.form-item--error input,
.complete-profile-form .form-item.form-item--error select,
.complete-profile-form .form-item.error input,
.complete-profile-form .form-item.error select,
.complete-profile-form input.error,
.complete-profile-form select.error {
  border-color: #d32f2f !important;
  background-color: #fff5f5 !important;
  border-width: 2px !important;
}

/* Password fieldset error state */
.complete-profile-form .password-fieldset.has-error,
.complete-profile-form .password-fieldset .form-item--error {
  border-color: #d32f2f;
}

.complete-profile-form .password-fieldset .form-item--error input[type="password"],
.complete-profile-form .password-fieldset input.error[type="password"] {
  border-color: #d32f2f !important;
  background-color: #fff5f5 !important;
  border-width: 2px !important;
}

/* Error icon for inline errors */
.complete-profile-form .form-item--error-message::before,
.complete-profile-form .error-message::before {
  content: "⚠ ";
  margin-right: 0.25rem;
}

/* Password confirm specific error */
.complete-profile-form .password-confirm .error,
.complete-profile-form .password-confirm .form-item--error-message {
  background-color: #ffebee;
  border-left: 3px solid #d32f2f;
  color: #d32f2f;
  padding: 0.75rem;
  margin-top: 0.75rem;
  border-radius: 4px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.complete-profile-form .password-confirm .error::before {
  content: "⚠️ ";
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

/* Mobile number error styling */
.complete-profile-form .form-item--error input[type="tel"],
.complete-profile-form input.error[type="tel"] {
  border-color: #d32f2f !important;
  background-color: #fff5f5 !important;
  border-width: 2px !important;
}

/* Make sure errors are visible */
.complete-profile-form .error,
.complete-profile-form .form-item--error-message {
  display: block !important;
  visibility: visible !important;
}
