// Shared field styles with modern UI enhancements following UI rules
.field-container {
  margin-bottom: 24px;
  position: relative;
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sq-form-label {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--theme-text);
  margin-bottom: 8px;
  font-family: var(--theme-font-primary);
  letter-spacing: 0.02em;
  
  .label-text {
    flex: 1;
  }
  
  .required-indicator {
    color: var(--theme-error, #ef4444);
    margin-left: 6px;
    font-size: 16px;
    line-height: 1;
  }
}

.sq-form-input,
.sq-form-textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--theme-text);
  background: var(--theme-surface);
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 0;
  font-family: var(--theme-font-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
  
  &:focus {
    outline: none;
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    background: var(--theme-surface);
    transform: translateY(-2px);
  }

  &:disabled {
    background: var(--theme-background);
    color: var(--theme-text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
  }

  &.error {
    border-color: var(--theme-error, #ef4444);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
    animation: shake 0.5s ease-in-out;
  }

  &::placeholder {
    color: var(--theme-text-secondary);
    font-style: italic;
    opacity: 0.7;
  }
  
  &:hover:not(:disabled):not(:focus) {
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.sq-form-textarea {
  min-height: 120px;
  resize: vertical;
  border-radius: 12px;
}

.field-description {
  color: var(--theme-text-secondary);
  font-size: 13px;
  margin-top: 8px;
  font-style: italic;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  
  &::before {
    content: "ℹ";
    margin-right: 6px;
    font-size: 12px;
  }
}

.sq-error-message {
  color: var(--theme-error, #ef4444);
  font-size: 13px;
  margin-top: 8px;
  font-weight: 500;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--theme-error, #ef4444);
  
  &::before {
    content: "⚠";
    margin-right: 8px;
    font-size: 16px;
  }
}

// Phone field specific styles
.phone-input-container {
  position: relative;
  display: flex;
  align-items: center;
  
  .phone-input {
    flex: 1;
    border-radius: 12px;
    padding-left: 100px;
  }
  
  .country-code-selector {
    position: absolute;
    left: 2px;
    top: 2px;
    bottom: 2px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--theme-background);
    border-radius: 10px 0 0 10px;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    
    &:hover {
      background: var(--theme-surface);
    }
    
    .country-flag {
      margin-right: 8px;
      font-size: 18px;
    }
    
    .country-code {
      font-weight: 500;
      color: var(--theme-text);
    }
    
    .dropdown-icon {
      margin-left: 6px;
      transition: transform 0.2s ease;
    }
  }
  
  .country-code-btn {
    margin-left: 8px;
    min-width: 80px;
    border-radius: 12px;
  }
}

// Password field specific styles with modern enhancements
.password-input-container {
  position: relative;
  display: flex;
  
  .password-input {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
  }
  
  .password-toggle {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
    height: 48px;
    background: var(--theme-background);
    border: 2px solid rgba(0, 0, 0, 0.08);
    transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--theme-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    cursor: pointer;
    
    &:hover {
      background: var(--theme-surface);
      color: var(--theme-text);
    }
    
    &:focus {
      border-color: var(--theme-primary);
      box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
      outline: none;
    }
    
    clr-icon {
      width: 18px;
      height: 18px;
    }
  }
}

.password-strength {
  display: flex;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  background: var(--theme-background);
  border-radius: 12px;
  transition: all 0.3s ease;
  
  &.weak {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
  }
  
  &.medium {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
  }
  
  &.strong {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
  }
  
  .strength-meter {
    flex: 1;
    height: 10px;
    background-color: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
    margin-right: 16px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    
    .strength-bar {
      height: 100%;
      border-radius: 5px;
      transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
      
      &.weak {
        background: linear-gradient(90deg, #ef4444 0%, #ef4444 100%);
        width: 33%;
      }
      
      &.medium {
        background: linear-gradient(90deg, #ef4444 0%, #f59e0b 100%);
        width: 66%;
      }
      
      &.strong {
        background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
        width: 100%;
      }
    }
  }
  
  .strength-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--theme-text-secondary);
    min-width: 100px;
    text-align: right;
    
    &.weak {
      color: #ef4444;
    }
    
    &.medium {
      color: #f59e0b;
    }
    
    &.strong {
      color: #10b981;
    }
  }
}

// Character count for text areas with modern styling
.character-count {
  text-align: right;
  font-size: 13px;
  color: var(--theme-text-secondary);
  margin-top: 8px;
  font-weight: 500;
  padding: 6px 12px;
  background: var(--theme-background);
  border-radius: 20px;
  display: inline-block;
  float: right;
  transition: all 0.2s ease;
  
  &.warning {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
  }
  
  &.error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
  }
}

// Enhanced input group for better visual hierarchy
.input-group {
  position: relative;
  margin-bottom: 24px;
  
  .input-group-prepend,
  .input-group-append {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    color: var(--theme-text-secondary);
    padding: 0 12px;
  }
  
  .input-group-prepend {
    left: 12px;
  }
  
  .input-group-append {
    right: 12px;
  }
  
  .input-with-addon {
    padding-left: 40px;
  }
}